@mindstudio-ai/agent 0.1.169 → 0.1.171
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/CHANGELOG.md +21 -0
- package/dist/cli.js +37 -37
- package/dist/index.d.ts +58 -16
- package/dist/index.js +30 -30
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +37 -37
- package/llms.txt +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ What changed in `@mindstudio-ai/agent`, newest first, each version under its own
|
|
|
4
4
|
|
|
5
5
|
Versions before 0.1.163 aren't recorded here.
|
|
6
6
|
|
|
7
|
+
## 0.1.171
|
|
8
|
+
|
|
9
|
+
### New
|
|
10
|
+
|
|
11
|
+
- `evaluateDecision` can run on Nace.AI's Drex, served by DeepInfra: `decisionModelOverride.model` set to `drex-max`, `drex-v2.0` or `drex-v1.5`. Each takes at most 16 questions, and `drex-max` also reads up to 4 PNG, JPEG, WebP or GIF images, 9 MiB together. The usage notes say so. App code isn't affected.
|
|
12
|
+
- `push()`, `update()` and `upsert()` take `created_at`, `updated_at` (unix ms) and `last_updated_by` (a user's id), so an import or a scenario's seed data can carry a record's real history: a case reported three days ago, last touched by someone else. Whichever a write leaves out the platform fills in, as before: now, and the signed-in user (or nobody). An update that leaves them out still advances `updated_at` and stamps `last_updated_by`. `id` is still always the platform's. A database takes the change at its next schema sync in dev, or its next publish in live; until then a given `updated_at` or `last_updated_by` is overwritten as before.
|
|
13
|
+
|
|
14
|
+
### Changed behavior
|
|
15
|
+
|
|
16
|
+
- A write that carries `created_at`, `updated_at` or `last_updated_by` now writes them, where before they were dropped. The case to check is a row spread from one read back: `push({ ...row, name: 'Copy' })` used to give the copy fresh dates and the current user, and now keeps the original's. Leave those three out of a copy that should look new. An update that spreads a read row back is unaffected, since unchanged values are still advanced and stamped.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `email.send`'s docs say who an app can mail. An app with neither its own subdomain nor a verified sending domain sends from the platform's shared address, which only mails the app's verified users and its workspace's members, in dev and live alike, and refuses the whole send with `unverified_recipients` (400) otherwise. The rule isn't new. An app that mails people who haven't signed in, such as a form's acknowledgement, should check it has a subdomain or a sending domain.
|
|
21
|
+
|
|
22
|
+
## 0.1.170
|
|
23
|
+
|
|
24
|
+
### Changed behavior
|
|
25
|
+
|
|
26
|
+
- The auth table's `email` and `phone` columns are writable from code: `push()`, `update()` and `upsert()` no longer throw `managed_column_write` for them, so a seed, an import or a test fixture can create users with addresses, and whoever proves an address signs into its row (a "Sign in with Remy" user's row excepted, which only they sign into). From 0.1.149 to 0.1.169 every such write threw; before that, a write made before the table's first round trip in a process slipped past the check. The `apiKey` column still throws. A signed-in user changing their own address still goes through `auth.requestEmailChange()` / `auth.requestPhoneChange()` in `@mindstudio-ai/interface`. Code that caught `managed_column_write` for an email or phone write no longer gets it.
|
|
27
|
+
|
|
7
28
|
## 0.1.169
|
|
8
29
|
|
|
9
30
|
### Changed behavior
|
package/dist/cli.js
CHANGED
|
@@ -299,7 +299,7 @@ var init_metadata = __esm({
|
|
|
299
299
|
"evaluateDecision": {
|
|
300
300
|
stepType: "evaluateDecision",
|
|
301
301
|
description: "Ask structured questions about text, JSON, or images and get calibrated answers from a decision model. The model returns a probability, a selected option, or a score. It does not write a reply. Each question is a noul (yes or no, as a probability from 0 to 1), a choice (one option from a set you define, with a probability for each), or a score (a rating against ordered levels). Put every question in the same call. The question id is yours: answers come back under the same ids. The model defaults to Jev (jev-latest).",
|
|
302
|
-
usageNotes: "- state is the content to judge: a string, or a JSON object or array (a record, a chat log, application state).\n- questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.\n- A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.\n- A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.\n- A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.\n- An answer of type refusal means the model declined that question (GPT-6 Luna Decisions can).\n- instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.\n- Send every question you need in one call. The model reads the state once and answers them together.\n- Probabilities from different models are not comparable: tune a threshold against the model, and the version, it will run on.\n- decisionModelOverride.model picks the model:\n - jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.\n - clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.\n - mercury-decide runs Inception's Mercury Decide, which reads up to 64k tokens and up to 16 PNG, JPEG, WebP, or GIF images, each at most 10 MiB and 14 MiB together.\n - gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.\n- images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.\n- The response model field is the version that answered.\n- Billed per input token. Output tokens are free. Each model has its own rate, and GPT-6 Luna Decisions bills a prompt over 272k tokens at twice its rate.",
|
|
302
|
+
usageNotes: "- state is the content to judge: a string, or a JSON object or array (a record, a chat log, application state).\n- questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.\n- A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.\n- A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.\n- A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.\n- An answer of type refusal means the model declined that question (GPT-6 Luna Decisions can).\n- instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.\n- Send every question you need in one call. The model reads the state once and answers them together.\n- Probabilities from different models are not comparable: tune a threshold against the model, and the version, it will run on.\n- decisionModelOverride.model picks the model:\n - jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.\n - clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.\n - mercury-decide runs Inception's Mercury Decide, which reads up to 64k tokens and up to 16 PNG, JPEG, WebP, or GIF images, each at most 10 MiB and 14 MiB together.\n - drex-max, drex-v2.0 and drex-v1.5 run Nace.AI's Drex, served by DeepInfra, and take at most 16 questions. drex-max reads up to 262k tokens and up to 4 PNG, JPEG, WebP, or GIF images, 9 MiB together. drex-v2.0 and drex-v1.5 read text only, up to 128k tokens. nace-ai/drex-max, nace-ai/drex-v2.0 and nace-ai/drex-v1.5 name the same three.\n - gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.\n- images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.\n- The response model field is the version that answered.\n- Billed per input token. Output tokens are free. Each model has its own rate, and GPT-6 Luna Decisions bills a prompt over 272k tokens at twice its rate.",
|
|
303
303
|
inputSchema: { "type": "object", "properties": { "state": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": {}, "required": [] }, { "type": "array", "items": {} }] }, "questions": { "type": "object", "properties": {}, "required": [], "description": "Questions to ask about the state, keyed by an id you choose." }, "images": { "type": "array", "items": { "type": "string" }, "description": "Images for a model that reads them (Clef, Clef Flash, GPT-6 Luna Decisions). Each entry is a URL or a data URL. A model that reads none refuses the call." }, "decisionModelOverride": { "type": "object", "properties": { "model": { "type": "string", "description": "Decision model: a catalog id, its vendor's name for it (`@cf/cloudflare/clef`, `gpt-6-luna`), or a version it pins (`jev-1.13.0`)" }, "config": { "type": "object", "properties": {}, "required": [], "description": "Additional model-specific configuration" } }, "required": ["model"], "description": "Optional model override. Uses the workspace's default decision model (Jev) if not specified" } }, "required": ["state", "questions"] },
|
|
304
304
|
outputSchema: { "type": "object", "properties": { "model": { "type": "string", "description": "Versioned model id that answered, such as jev-1.13.0." }, "answers": { "type": "object", "properties": {}, "required": [], "description": "One answer per question, under the same ids." }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "number" }, "output_tokens": { "type": "number" } }, "required": ["input_tokens", "output_tokens"], "description": "Token counts for the call. Input tokens are what the model bills." } }, "required": ["model", "answers", "usage"] }
|
|
305
305
|
},
|
|
@@ -1860,7 +1860,8 @@ function serializeParam(val) {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
function serializeColumnParam(val, columnName, columns) {
|
|
1862
1862
|
const col = columnsByName(columns).get(columnName);
|
|
1863
|
-
|
|
1863
|
+
const isUserColumn = col?.type === "user" || columnName === "last_updated_by";
|
|
1864
|
+
if (isUserColumn && typeof val === "string") {
|
|
1864
1865
|
return val.startsWith(USER_PREFIX) ? val : `${USER_PREFIX}${val}`;
|
|
1865
1866
|
}
|
|
1866
1867
|
return serializeParam(val);
|
|
@@ -2055,7 +2056,7 @@ function buildExists(table, where, whereParams, negate) {
|
|
|
2055
2056
|
};
|
|
2056
2057
|
}
|
|
2057
2058
|
function buildInsert(table, data, columns) {
|
|
2058
|
-
const filtered =
|
|
2059
|
+
const filtered = stripPlatformColumns(data);
|
|
2059
2060
|
const keys = Object.keys(filtered);
|
|
2060
2061
|
const placeholders = keys.map(() => "?").join(", ");
|
|
2061
2062
|
const params = keys.map((k) => serializeColumnParam(filtered[k], k, columns));
|
|
@@ -2065,7 +2066,7 @@ function buildInsert(table, data, columns) {
|
|
|
2065
2066
|
};
|
|
2066
2067
|
}
|
|
2067
2068
|
function buildUpdate(table, id, data, columns) {
|
|
2068
|
-
const filtered =
|
|
2069
|
+
const filtered = stripPlatformColumns(data);
|
|
2069
2070
|
const keys = Object.keys(filtered);
|
|
2070
2071
|
const assignments = keys.map((k) => `${k} = ?`).join(", ");
|
|
2071
2072
|
const params = [
|
|
@@ -2079,7 +2080,7 @@ function buildUpdate(table, id, data, columns) {
|
|
|
2079
2080
|
};
|
|
2080
2081
|
}
|
|
2081
2082
|
function buildUpsert(table, data, conflictColumns, columns) {
|
|
2082
|
-
const filtered =
|
|
2083
|
+
const filtered = stripPlatformColumns(data);
|
|
2083
2084
|
const keys = Object.keys(filtered);
|
|
2084
2085
|
const placeholders = keys.map(() => "?").join(", ");
|
|
2085
2086
|
const params = keys.map((k) => serializeColumnParam(filtered[k], k, columns));
|
|
@@ -2095,16 +2096,16 @@ function buildDelete(table, where, whereParams) {
|
|
|
2095
2096
|
}
|
|
2096
2097
|
return { sql, params: whereParams?.length ? whereParams : void 0 };
|
|
2097
2098
|
}
|
|
2098
|
-
function
|
|
2099
|
+
function stripPlatformColumns(data) {
|
|
2099
2100
|
const result = {};
|
|
2100
2101
|
for (const [key, value] of Object.entries(data)) {
|
|
2101
|
-
if (!
|
|
2102
|
+
if (!PLATFORM_COLUMNS.has(key)) {
|
|
2102
2103
|
result[key] = value;
|
|
2103
2104
|
}
|
|
2104
2105
|
}
|
|
2105
2106
|
return result;
|
|
2106
2107
|
}
|
|
2107
|
-
var USER_PREFIX, byNameCache, SQL_IDENTIFIER_RE,
|
|
2108
|
+
var USER_PREFIX, byNameCache, SQL_IDENTIFIER_RE, PLATFORM_COLUMNS;
|
|
2108
2109
|
var init_sql = __esm({
|
|
2109
2110
|
"src/db/sql.ts"() {
|
|
2110
2111
|
"use strict";
|
|
@@ -2112,13 +2113,10 @@ var init_sql = __esm({
|
|
|
2112
2113
|
USER_PREFIX = "@@user@@";
|
|
2113
2114
|
byNameCache = /* @__PURE__ */ new WeakMap();
|
|
2114
2115
|
SQL_IDENTIFIER_RE = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
|
|
2115
|
-
|
|
2116
|
+
PLATFORM_COLUMNS = /* @__PURE__ */ new Set([
|
|
2116
2117
|
"id",
|
|
2117
|
-
"created_at",
|
|
2118
2118
|
"createdAt",
|
|
2119
|
-
"updated_at",
|
|
2120
2119
|
"updatedAt",
|
|
2121
|
-
"last_updated_by",
|
|
2122
2120
|
"lastUpdatedBy"
|
|
2123
2121
|
]);
|
|
2124
2122
|
}
|
|
@@ -3887,7 +3885,7 @@ var init_table = __esm({
|
|
|
3887
3885
|
(item) => this._config.defaults ? { ...this._config.defaults, ...item } : item
|
|
3888
3886
|
);
|
|
3889
3887
|
const build = () => items.map((item) => {
|
|
3890
|
-
this.
|
|
3888
|
+
this._checkApiKeyWrite(item);
|
|
3891
3889
|
return buildInsert(
|
|
3892
3890
|
this._config.tableName,
|
|
3893
3891
|
item,
|
|
@@ -3916,10 +3914,13 @@ var init_table = __esm({
|
|
|
3916
3914
|
/**
|
|
3917
3915
|
* Update a row by ID. Only the provided fields are changed.
|
|
3918
3916
|
* Returns the updated row via `UPDATE ... RETURNING *`.
|
|
3917
|
+
*
|
|
3918
|
+
* The platform advances `updated_at` and stamps `last_updated_by` with the
|
|
3919
|
+
* signed-in user unless the data changes them itself.
|
|
3919
3920
|
*/
|
|
3920
3921
|
update(id, data) {
|
|
3921
3922
|
const build = () => {
|
|
3922
|
-
this.
|
|
3923
|
+
this._checkApiKeyWrite(data);
|
|
3923
3924
|
return [
|
|
3924
3925
|
buildUpdate(this._config.tableName, id, data, this._config.columns)
|
|
3925
3926
|
];
|
|
@@ -4011,6 +4012,8 @@ var init_table = __esm({
|
|
|
4011
4012
|
* @param conflictKey - Column name(s) that form the unique constraint.
|
|
4012
4013
|
* Pass a single string for single-column unique, or an array for compound.
|
|
4013
4014
|
* @param data - Row data to insert (or update on conflict). Defaults apply.
|
|
4015
|
+
* A `created_at`, `updated_at` or `last_updated_by` it gives is written
|
|
4016
|
+
* either way; whichever it leaves out the platform fills in.
|
|
4014
4017
|
*/
|
|
4015
4018
|
upsert(conflictKey, data) {
|
|
4016
4019
|
const conflictColumns = Array.isArray(conflictKey) ? conflictKey : [conflictKey];
|
|
@@ -4026,7 +4029,7 @@ var init_table = __esm({
|
|
|
4026
4029
|
}
|
|
4027
4030
|
}
|
|
4028
4031
|
const build = () => {
|
|
4029
|
-
this.
|
|
4032
|
+
this._checkApiKeyWrite(withDefaults);
|
|
4030
4033
|
return [
|
|
4031
4034
|
buildUpsert(
|
|
4032
4035
|
this._config.tableName,
|
|
@@ -4055,22 +4058,19 @@ var init_table = __esm({
|
|
|
4055
4058
|
// -------------------------------------------------------------------------
|
|
4056
4059
|
// Internal helpers
|
|
4057
4060
|
// -------------------------------------------------------------------------
|
|
4058
|
-
/**
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
const
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
400
|
|
4072
|
-
);
|
|
4073
|
-
}
|
|
4061
|
+
/**
|
|
4062
|
+
* @internal Throw if data writes the auth table's API key column, which holds
|
|
4063
|
+
* the masked key the platform issued. The other mapped columns are the app's
|
|
4064
|
+
* to write.
|
|
4065
|
+
*/
|
|
4066
|
+
_checkApiKeyWrite(data) {
|
|
4067
|
+
const column = this._config.managedColumns?.apiKey;
|
|
4068
|
+
if (column && Object.keys(data).includes(column)) {
|
|
4069
|
+
throw new MindStudioError(
|
|
4070
|
+
`Cannot write to "${column}" \u2014 this column is managed by auth. Use the auth API to issue or revoke a user's API key.`,
|
|
4071
|
+
"managed_column_write",
|
|
4072
|
+
400
|
|
4073
|
+
);
|
|
4074
4074
|
}
|
|
4075
4075
|
}
|
|
4076
4076
|
/**
|
|
@@ -9472,7 +9472,7 @@ async function startMcpServer(options) {
|
|
|
9472
9472
|
capabilities: { tools: {} },
|
|
9473
9473
|
serverInfo: {
|
|
9474
9474
|
name: "mindstudio-agent",
|
|
9475
|
-
version: "0.1.
|
|
9475
|
+
version: "0.1.171"
|
|
9476
9476
|
},
|
|
9477
9477
|
instructions: 'Welcome to MindStudio \u2014 a platform with 200+ AI models, 850+ third-party integrations, and pre-built agents.\n\nGetting started:\n1. Call `ask` with any question about the SDK \u2014 it knows every action, model, and connector and returns working code with real model IDs and config options. Examples: ask("generate an image with FLUX"), ask("what models support vision?"), ask("how do I send a Slack message?").\n2. Call `changeName` to set your display name \u2014 use your name or whatever your user calls you. This is how you\'ll appear in MindStudio request logs.\n3. If you have a profile picture, pass its public image URL to `changeProfilePicture`.\n4. For manual browsing, call `listActions` to discover all available actions.\n\nThen use the tools to generate text, images, video, audio, search the web, work with data sources, run agents, and more.\n\nImportant:\n- AI-powered actions (text generation, image generation, video, audio, etc.) cost money. Before running these, call `estimateActionCost` and confirm with the user before proceeding \u2014 unless they\'ve explicitly told you to go ahead.\n- Not all agents from `listAgents` are configured for API use. Do not try to run an agent just because it appears in the list \u2014 it will likely fail. Only run agents the user specifically asks you to run.'
|
|
9478
9478
|
});
|
|
@@ -10512,7 +10512,7 @@ function isNewerVersion(current, latest) {
|
|
|
10512
10512
|
return false;
|
|
10513
10513
|
}
|
|
10514
10514
|
async function checkForUpdate() {
|
|
10515
|
-
const currentVersion = "0.1.
|
|
10515
|
+
const currentVersion = "0.1.171";
|
|
10516
10516
|
if (!currentVersion || process.env.MINDSTUDIO_NO_UPDATE_CHECK) {
|
|
10517
10517
|
return null;
|
|
10518
10518
|
}
|
|
@@ -10547,7 +10547,7 @@ async function checkForUpdate() {
|
|
|
10547
10547
|
}
|
|
10548
10548
|
}
|
|
10549
10549
|
function printUpdateNotice(latestVersion) {
|
|
10550
|
-
const currentVersion = "0.1.
|
|
10550
|
+
const currentVersion = "0.1.171";
|
|
10551
10551
|
process.stderr.write(
|
|
10552
10552
|
`
|
|
10553
10553
|
${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
|
|
@@ -10560,7 +10560,7 @@ function isStandaloneBinary() {
|
|
|
10560
10560
|
return !argv1.includes("node_modules");
|
|
10561
10561
|
}
|
|
10562
10562
|
async function cmdUpdate() {
|
|
10563
|
-
const currentVersion = "0.1.
|
|
10563
|
+
const currentVersion = "0.1.171";
|
|
10564
10564
|
process.stderr.write(
|
|
10565
10565
|
` ${ansi2.gray("Current version:")} ${currentVersion}
|
|
10566
10566
|
`
|
|
@@ -10701,7 +10701,7 @@ async function cmdLogin(options) {
|
|
|
10701
10701
|
process.stderr.write("\n");
|
|
10702
10702
|
printLogo();
|
|
10703
10703
|
process.stderr.write("\n");
|
|
10704
|
-
const ver = "0.1.
|
|
10704
|
+
const ver = "0.1.171";
|
|
10705
10705
|
process.stderr.write(
|
|
10706
10706
|
` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
|
|
10707
10707
|
`
|
|
@@ -11029,7 +11029,7 @@ async function main() {
|
|
|
11029
11029
|
const updatePromise = command !== "mcp" && command !== "login" && command !== "update" ? checkForUpdate() : Promise.resolve(null);
|
|
11030
11030
|
try {
|
|
11031
11031
|
if (command === "version" || command === "-v") {
|
|
11032
|
-
process.stdout.write("0.1.
|
|
11032
|
+
process.stdout.write("0.1.171\n");
|
|
11033
11033
|
return;
|
|
11034
11034
|
}
|
|
11035
11035
|
if (command === "login") {
|
package/dist/index.d.ts
CHANGED
|
@@ -991,7 +991,8 @@ declare const Roles: Record<string, string>;
|
|
|
991
991
|
*
|
|
992
992
|
* Key concepts:
|
|
993
993
|
* - **SystemFields**: columns managed by the platform (id, timestamps, audit).
|
|
994
|
-
*
|
|
994
|
+
* Never part of a table's own write input; a write may still set the
|
|
995
|
+
* timestamps and the author (`SettableSystemColumns`), never `id`.
|
|
995
996
|
* - **Predicate / Accessor**: callback shapes used in filter(), sortBy(), etc.
|
|
996
997
|
* Predicates are compiled to SQL WHERE clauses when possible, with a JS
|
|
997
998
|
* fallback for complex expressions.
|
|
@@ -1005,10 +1006,11 @@ declare const Roles: Record<string, string>;
|
|
|
1005
1006
|
* - `id`: UUID primary key, generated on INSERT
|
|
1006
1007
|
* - `created_at`: unix timestamp (ms), set on INSERT
|
|
1007
1008
|
* - `updated_at`: unix timestamp (ms), set on INSERT and every UPDATE
|
|
1008
|
-
* - `last_updated_by`:
|
|
1009
|
+
* - `last_updated_by`: the user who last wrote this row
|
|
1009
1010
|
*
|
|
1010
|
-
* Both snake_case (platform convention) and camelCase (legacy) are
|
|
1011
|
-
*
|
|
1011
|
+
* Both snake_case (platform convention) and camelCase (legacy) are left
|
|
1012
|
+
* out of a table's own input types, to support either naming convention in
|
|
1013
|
+
* table interfaces. The snake_case ones come back as `SettableSystemColumns`.
|
|
1012
1014
|
*/
|
|
1013
1015
|
type SystemFields = 'id' | 'created_at' | 'createdAt' | 'updated_at' | 'updatedAt' | 'last_updated_by' | 'lastUpdatedBy';
|
|
1014
1016
|
/**
|
|
@@ -1024,22 +1026,39 @@ interface SystemColumns {
|
|
|
1024
1026
|
last_updated_by: string;
|
|
1025
1027
|
}
|
|
1026
1028
|
/**
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
+
* The system columns a write may set, to carry a record's history in (an
|
|
1030
|
+
* import, a scenario's seed data). Whichever a write leaves out the platform
|
|
1031
|
+
* fills in: `created_at` and `updated_at` with now, and `last_updated_by` with
|
|
1032
|
+
* the signed-in user (or nobody). An update that leaves them out advances
|
|
1033
|
+
* `updated_at` and stamps `last_updated_by`, as every write does. `id` is
|
|
1034
|
+
* always the platform's.
|
|
1035
|
+
*/
|
|
1036
|
+
interface SettableSystemColumns {
|
|
1037
|
+
/** When the row was created, unix ms. */
|
|
1038
|
+
created_at?: number;
|
|
1039
|
+
/** When the row was last changed, unix ms. */
|
|
1040
|
+
updated_at?: number;
|
|
1041
|
+
/** The id of the user who last changed the row. */
|
|
1042
|
+
last_updated_by?: string;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Input type for `Table.push()`. Excludes `id`, which the platform
|
|
1046
|
+
* generates, and takes the other system columns optionally
|
|
1047
|
+
* (`SettableSystemColumns`). Optional fields in T remain optional.
|
|
1029
1048
|
*
|
|
1030
1049
|
* @example
|
|
1031
1050
|
* ```ts
|
|
1032
1051
|
* // If Order has { item: string; amount: number }
|
|
1033
1052
|
* // then PushInput<Order> is { item: string; amount: number }
|
|
1034
|
-
* //
|
|
1053
|
+
* // plus optional created_at, updated_at and last_updated_by
|
|
1035
1054
|
* ```
|
|
1036
1055
|
*/
|
|
1037
|
-
type PushInput<T> = Omit<T, SystemFields
|
|
1056
|
+
type PushInput<T> = Omit<T, SystemFields> & SettableSystemColumns;
|
|
1038
1057
|
/**
|
|
1039
|
-
* Input type for `Table.update()`.
|
|
1040
|
-
*
|
|
1058
|
+
* Input type for `Table.update()`. Every field is optional (partial update),
|
|
1059
|
+
* the settable system columns included; `id` is never written.
|
|
1041
1060
|
*/
|
|
1042
|
-
type UpdateInput<T> = Partial<Omit<T, SystemFields
|
|
1061
|
+
type UpdateInput<T> = Partial<Omit<T, SystemFields>> & SettableSystemColumns;
|
|
1043
1062
|
/**
|
|
1044
1063
|
* A predicate function for filtering rows. Receives a typed row and
|
|
1045
1064
|
* returns a boolean.
|
|
@@ -1117,7 +1136,8 @@ interface TableConfig {
|
|
|
1117
1136
|
defaults?: Record<string, unknown>;
|
|
1118
1137
|
/**
|
|
1119
1138
|
* Platform-managed auth columns. Set when this table is the app's auth
|
|
1120
|
-
* table. Writes to
|
|
1139
|
+
* table. Writes to the apiKey column throw; email, phone and roles are the
|
|
1140
|
+
* app's to write, and a roles write syncs to the platform.
|
|
1121
1141
|
*/
|
|
1122
1142
|
managedColumns?: {
|
|
1123
1143
|
email?: string;
|
|
@@ -1659,7 +1679,12 @@ declare class Table<T> {
|
|
|
1659
1679
|
select<K extends keyof T & string>(...columns: K[]): Query<Pick<T, K>>;
|
|
1660
1680
|
/**
|
|
1661
1681
|
* Insert one or more rows. Returns the created row(s) with system fields
|
|
1662
|
-
* populated (id,
|
|
1682
|
+
* populated (id, created_at, updated_at, last_updated_by).
|
|
1683
|
+
*
|
|
1684
|
+
* A row may give its own `created_at`, `updated_at` and `last_updated_by`
|
|
1685
|
+
* (an import, a scenario's history); the platform fills in whichever it
|
|
1686
|
+
* leaves out, and always generates `id`. So a row spread from one read
|
|
1687
|
+
* back (`push({ ...row, name })`) keeps that row's dates and author.
|
|
1663
1688
|
*
|
|
1664
1689
|
* Uses `INSERT ... RETURNING *` so the created row comes back in a
|
|
1665
1690
|
* single round trip — no separate SELECT needed.
|
|
@@ -1669,6 +1694,9 @@ declare class Table<T> {
|
|
|
1669
1694
|
/**
|
|
1670
1695
|
* Update a row by ID. Only the provided fields are changed.
|
|
1671
1696
|
* Returns the updated row via `UPDATE ... RETURNING *`.
|
|
1697
|
+
*
|
|
1698
|
+
* The platform advances `updated_at` and stamps `last_updated_by` with the
|
|
1699
|
+
* signed-in user unless the data changes them itself.
|
|
1672
1700
|
*/
|
|
1673
1701
|
update(id: string, data: UpdateInput<T>): Mutation<T>;
|
|
1674
1702
|
remove(id: string): Mutation<{
|
|
@@ -1690,10 +1718,16 @@ declare class Table<T> {
|
|
|
1690
1718
|
* @param conflictKey - Column name(s) that form the unique constraint.
|
|
1691
1719
|
* Pass a single string for single-column unique, or an array for compound.
|
|
1692
1720
|
* @param data - Row data to insert (or update on conflict). Defaults apply.
|
|
1721
|
+
* A `created_at`, `updated_at` or `last_updated_by` it gives is written
|
|
1722
|
+
* either way; whichever it leaves out the platform fills in.
|
|
1693
1723
|
*/
|
|
1694
1724
|
upsert(conflictKey: (keyof Omit<T, SystemFields> & string) | (keyof Omit<T, SystemFields> & string)[], data: PushInput<T>): Mutation<T>;
|
|
1695
|
-
/**
|
|
1696
|
-
|
|
1725
|
+
/**
|
|
1726
|
+
* @internal Throw if data writes the auth table's API key column, which holds
|
|
1727
|
+
* the masked key the platform issued. The other mapped columns are the app's
|
|
1728
|
+
* to write.
|
|
1729
|
+
*/
|
|
1730
|
+
private _checkApiKeyWrite;
|
|
1697
1731
|
/**
|
|
1698
1732
|
* @internal Fire role sync for rows that wrote to the roles column.
|
|
1699
1733
|
* Called inside processResult (runs after SQL execution in both
|
|
@@ -3959,6 +3993,13 @@ interface Email {
|
|
|
3959
3993
|
* with `email.batch(batchId)` (`status`, `pending`, chunk counts); outcomes
|
|
3960
3994
|
* (delivered, bounced, complained) arrive later on `email.messages({ batchId })`.
|
|
3961
3995
|
*
|
|
3996
|
+
* Who you can mail depends on the sender. From the app's own subdomain or a
|
|
3997
|
+
* verified sending domain, anyone. An app with neither sends from the
|
|
3998
|
+
* platform's shared address, which only mails the app's verified users and its
|
|
3999
|
+
* workspace's members, in dev and live alike, and refuses the whole send with
|
|
4000
|
+
* `unverified_recipients` (400) otherwise. Mail to people who haven't signed in
|
|
4001
|
+
* (a form's acknowledgement, an invite) needs a subdomain or sending domain.
|
|
4002
|
+
*
|
|
3962
4003
|
* Throws `outbound_daily_cap_exceeded` (429) over the app's daily recipient
|
|
3963
4004
|
* quota — check `email.quota()` before a big send — and `sending_paused` (409)
|
|
3964
4005
|
* when the app's sending is paused for reputation or by support; a 409 will
|
|
@@ -9988,6 +10029,7 @@ interface StepMethods {
|
|
|
9988
10029
|
* - jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.
|
|
9989
10030
|
* - clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.
|
|
9990
10031
|
* - mercury-decide runs Inception's Mercury Decide, which reads up to 64k tokens and up to 16 PNG, JPEG, WebP, or GIF images, each at most 10 MiB and 14 MiB together.
|
|
10032
|
+
* - drex-max, drex-v2.0 and drex-v1.5 run Nace.AI's Drex, served by DeepInfra, and take at most 16 questions. drex-max reads up to 262k tokens and up to 4 PNG, JPEG, WebP, or GIF images, 9 MiB together. drex-v2.0 and drex-v1.5 read text only, up to 128k tokens. nace-ai/drex-max, nace-ai/drex-v2.0 and nace-ai/drex-v1.5 name the same three.
|
|
9991
10033
|
* - gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.
|
|
9992
10034
|
* - images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.
|
|
9993
10035
|
* - The response model field is the version that answered.
|
|
@@ -12985,4 +13027,4 @@ declare const prerender: {
|
|
|
12985
13027
|
};
|
|
12986
13028
|
|
|
12987
13029
|
export { AuthContext, HttpResponse, MAX_EVENT_PAYLOAD_CHARS, MindStudioAgent, MindStudioError, Query, RESPONSE_BODY_MAX_BYTES, RawQuery, Roles, Store, Table, analytics, auth, blockTypeAliases, dataSources, db, mindstudio as default, defineJewel, defineMapper, defineReader, deletes, documents, email, events, files, getRequestContext, mindstudio, monacoSnippets, passthrough, prerender, reportIssue, resolveUser, respond, runWithContext, session, skip, stepMetadata, stream, voice, waitUntil };
|
|
12988
|
-
export type { Accessor, ActiveCampaignAddNoteStepInput, ActiveCampaignAddNoteStepOutput, ActiveCampaignCreateContactStepInput, ActiveCampaignCreateContactStepOutput, AddSubtitlesToVideoStepInput, AddSubtitlesToVideoStepOutput, AddThumbnailToVideoStepInput, AddThumbnailToVideoStepOutput, AgentInfo, AgentOptions, AggregateRow, AggregateSelect, AggregateTerm, AiSourceVendor, AirtableCreateUpdateRecordStepInput, AirtableCreateUpdateRecordStepOutput, AirtableDeleteRecordStepInput, AirtableDeleteRecordStepOutput, AirtableGetRecordStepInput, AirtableGetRecordStepOutput, AirtableGetTableRecordsStepInput, AirtableGetTableRecordsStepOutput, Analytics, AnalyticsDateRange, AnalyticsDimension, AnalyticsFilter, AnalyticsFilterOp, AnalyticsGranularity, AnalyticsMetric, AnalyticsQueryResponse, AnalyticsQueryResultRow, AnalyticsQuerySpec, AnalyticsReadOptions, AnalyzeImageStepInput, AnalyzeImageStepOutput, AnalyzeVideoStepInput, AnalyzeVideoStepOutput, AppAuthContext, AppContextResult, AppDatabase, AppDatabaseColumnSchema, AppDatabaseTable, AppRoleAssignment, AuthTableConfig, BatchStepInput, BatchStepResult, Batchable, CaptureThumbnailStepInput, CaptureThumbnailStepOutput, CheckAppRoleStepInput, CheckAppRoleStepOutput, CodaCreateUpdatePageStepInput, CodaCreateUpdatePageStepOutput, CodaCreateUpdateRowStepInput, CodaCreateUpdateRowStepOutput, CodaFindRowStepInput, CodaFindRowStepOutput, CodaGetPageStepInput, CodaGetPageStepOutput, CodaGetTableRowsStepInput, CodaGetTableRowsStepOutput, Connection, ConnectorActionDetail, ConnectorService, ConvertPdfToImagesStepInput, ConvertPdfToImagesStepOutput, CrawlerBucket, CrawlerHit, CrawlerOverview, CreateDataSourceStepInput, CreateDataSourceStepOutput, CreateGmailDraftStepInput, CreateGmailDraftStepOutput, CreateGoogleCalendarEventStepInput, CreateGoogleCalendarEventStepOutput, CreateGoogleDocStepInput, CreateGoogleDocStepOutput, CreateGoogleSheetStepInput, CreateGoogleSheetStepOutput, Db, DecomposeImageStepInput, DecomposeImageStepOutput, DefineStoreOptions, DefineTableOptions, DeleteDataSourceDocumentStepInput, DeleteDataSourceDocumentStepOutput, DeleteDataSourceStepInput, DeleteDataSourceStepOutput, DeleteGmailEmailStepInput, DeleteGmailEmailStepOutput, DeleteGoogleCalendarEventStepInput, DeleteGoogleCalendarEventStepOutput, DeleteGoogleSheetRowsStepInput, DeleteGoogleSheetRowsStepOutput, DetectChangesStepInput, DetectChangesStepOutput, DetectPIIStepInput, DetectPIIStepOutput, DownloadVideoStepInput, DownloadVideoStepOutput, EnhanceImageGenerationPromptStepInput, EnhanceImageGenerationPromptStepOutput, EnhanceVideoGenerationPromptStepInput, EnhanceVideoGenerationPromptStepOutput, EnrichPersonStepInput, EnrichPersonStepOutput, EvaluateDecisionStepInput, EvaluateDecisionStepOutput, EventGrantOptions, EventGrantResult, Events, ExecuteStepBatchOptions, ExecuteStepBatchResult, ExtractAudioFromVideoStepInput, ExtractAudioFromVideoStepOutput, ExtractTextStepInput, ExtractTextStepOutput, FetchDataSourceDocumentStepInput, FetchDataSourceDocumentStepOutput, FetchGoogleDocStepInput, FetchGoogleDocStepOutput, FetchGoogleSheetStepInput, FetchGoogleSheetStepOutput, FetchSlackChannelHistoryStepInput, FetchSlackChannelHistoryStepOutput, FetchYoutubeCaptionsStepInput, FetchYoutubeCaptionsStepOutput, FetchYoutubeChannelStepInput, FetchYoutubeChannelStepOutput, FetchYoutubeCommentsStepInput, FetchYoutubeCommentsStepOutput, FetchYoutubeVideoStepInput, FetchYoutubeVideoStepOutput, FileAccess, Files, FromSchema, Generate3dModelStepInput, Generate3dModelStepOutput, GenerateAssetStepInput, GenerateAssetStepOutput, GenerateImageStepInput, GenerateImageStepOutput, GenerateLipsyncStepInput, GenerateLipsyncStepOutput, GenerateMusicStepInput, GenerateMusicStepOutput, GeneratePdfStepInput, GeneratePdfStepOutput, GenerateSoundStepInput, GenerateSoundStepOutput, GenerateStaticVideoFromImageStepInput, GenerateStaticVideoFromImageStepOutput, GenerateTextStepInput, GenerateTextStepOutput, GenerateVideoStepInput, GenerateVideoStepOutput, GetGmailAttachmentsStepInput, GetGmailAttachmentsStepOutput, GetGmailDraftStepInput, GetGmailDraftStepOutput, GetGmailEmailStepInput, GetGmailEmailStepOutput, GetGmailUnreadCountStepInput, GetGmailUnreadCountStepOutput, GetGoogleCalendarEventStepInput, GetGoogleCalendarEventStepOutput, GetGoogleDriveFileStepInput, GetGoogleDriveFileStepOutput, GetGoogleSheetInfoStepInput, GetGoogleSheetInfoStepOutput, GetMediaMetadataStepInput, GetMediaMetadataStepOutput, GetStreamOptions, HttpResponseFile, HttpResponseHeaders, HttpResponseInit, HttpResponseOptions, HubspotCreateCompanyStepInput, HubspotCreateCompanyStepOutput, HubspotCreateContactStepInput, HubspotCreateContactStepOutput, HubspotGetCompanyStepInput, HubspotGetCompanyStepOutput, HubspotGetContactStepInput, HubspotGetContactStepOutput, HunterApiCompanyEnrichmentStepInput, HunterApiCompanyEnrichmentStepOutput, HunterApiDomainSearchStepInput, HunterApiDomainSearchStepOutput, HunterApiEmailFinderStepInput, HunterApiEmailFinderStepOutput, HunterApiEmailVerificationStepInput, HunterApiEmailVerificationStepOutput, HunterApiPersonEnrichmentStepInput, HunterApiPersonEnrichmentStepOutput, ImageFaceSwapStepInput, ImageFaceSwapStepOutput, ImageRemoveWatermarkStepInput, ImageRemoveWatermarkStepOutput, ImportFromUrlStepInput, ImportFromUrlStepOutput, InsertVideoClipsStepInput, InsertVideoClipsStepOutput, Jewel, JewelConfig, JewelGradeContext, JewelMethod, JewelMethodInput, JewelPairRecord, JewelProposal, JewelProposeOutcome, JewelProposeResult, JewelQueueItem, JewelQueueResolution, JewelQueueResolveResult, JewelRunParams, JewelVerdict, JewelsApi, JsonObjectSchema, JsonSchema, JsonSchemaTypeName, ListAgentsResult, ListDataSourcesStepInput, ListDataSourcesStepOutput, ListGmailDraftsStepInput, ListGmailDraftsStepOutput, ListGmailLabelsStepInput, ListGmailLabelsStepOutput, ListGoogleCalendarEventsStepInput, ListGoogleCalendarEventsStepOutput, ListGoogleDriveFilesStepInput, ListGoogleDriveFilesStepOutput, ListOptions, ListRecentGmailEmailsStepInput, ListRecentGmailEmailsStepOutput, LiveNow, LogicStepInput, LogicStepOutput, MakeDotComRunScenarioStepInput, MakeDotComRunScenarioStepOutput, MapObject, MapOutcome, MapPoint, MapRunObject, MapRunOutcome, MapRunParams, MapRunRecord, MapRunResult, MappedDocument, Mapper, MapperConfig, MergeAudioStepInput, MergeAudioStepOutput, MergeVideosStepInput, MergeVideosStepOutput, MeshyAnimateStepInput, MeshyAnimateStepOutput, MeshyImageTo3dStepInput, MeshyImageTo3dStepOutput, MeshyRemeshStepInput, MeshyRemeshStepOutput, MeshyRigStepInput, MeshyRigStepOutput, MeshyTextTo3dStepInput, MeshyTextTo3dStepOutput, MeshyTextureStepInput, MeshyTextureStepOutput, MindStudioModel, MindStudioModelSummary, MixAudioIntoVideoStepInput, MixAudioIntoVideoStepOutput, ModelType, MonacoSnippet, MonacoSnippetField, MonacoSnippetFieldType, MuteVideoStepInput, MuteVideoStepOutput, N8nRunNodeStepInput, N8nRunNodeStepOutput, NotionCreatePageStepInput, NotionCreatePageStepOutput, NotionUpdatePageStepInput, NotionUpdatePageStepOutput, PackagedWorkflow, PackagedWorkflowInput, PackagedWorkflowSignature, PeopleSearchStepInput, PeopleSearchStepOutput, PostToLinkedInStepInput, PostToLinkedInStepOutput, PostToSlackChannelStepInput, PostToSlackChannelStepOutput, PostToXStepInput, PostToXStepOutput, PostToZapierStepInput, PostToZapierStepOutput, Predicate, PushInput, PutOptions, PutStream, QueryDataSourceStepInput, QueryDataSourceStepOutput, QueryExternalDatabaseStepInput, QueryExternalDatabaseStepOutput, QuickbooksApiRequestStepInput, QuickbooksApiRequestStepOutput, ReadDelivery, ReadRunParams, ReadRunRecord, ReadRunResult, Reader, ReaderConfig, ReaderDocument, RedactPIIStepInput, RedactPIIStepOutput, RemoveBackgroundFromImageStepInput, RemoveBackgroundFromImageStepOutput, RenderVideoFromHtmlCompositionStepInput, RenderVideoFromHtmlCompositionStepOutput, ReplyToGmailEmailStepInput, ReplyToGmailEmailStepOutput, ReportIssueInput, ReportedIssue, RequestContext, ResizeVideoStepInput, ResizeVideoStepOutput, ResolvedUser, RunAgentOptions, RunAgentResult, RunFfmpegStepInput, RunFfmpegStepOutput, RunFromConnectorRegistryStepInput, RunFromConnectorRegistryStepOutput, RunTaskOptions, RunTaskOptionsWithExample, RunTaskOptionsWithSchema, RunTaskResult, SchemaValidationError, ScrapeLinkedInCompanyStepInput, ScrapeLinkedInCompanyStepOutput, ScrapeLinkedInProfileStepInput, ScrapeLinkedInProfileStepOutput, ScrapeUrlStepInput, ScrapeUrlStepOutput, ScrapeXPostStepInput, ScrapeXPostStepOutput, ScrapeXProfileStepInput, ScrapeXProfileStepOutput, ScreenshotUrlStepInput, ScreenshotUrlStepOutput, SearchGmailEmailsStepInput, SearchGmailEmailsStepOutput, SearchGoogleCalendarEventsStepInput, SearchGoogleCalendarEventsStepOutput, SearchGoogleDriveStepInput, SearchGoogleDriveStepOutput, SearchGoogleImagesStepInput, SearchGoogleImagesStepOutput, SearchGoogleNewsStepInput, SearchGoogleNewsStepOutput, SearchGoogleStepInput, SearchGoogleStepOutput, SearchGoogleTrendsStepInput, SearchGoogleTrendsStepOutput, SearchPerplexityStepInput, SearchPerplexityStepOutput, SearchXPostsStepInput, SearchXPostsStepOutput, SearchYoutubeStepInput, SearchYoutubeStepOutput, SearchYoutubeTrendsStepInput, SearchYoutubeTrendsStepOutput, SendEmailStepInput, SendEmailStepOutput, SendGmailDraftStepInput, SendGmailDraftStepOutput, SendGmailMessageStepInput, SendGmailMessageStepOutput, SendSMSStepInput, SendSMSStepOutput, SendSlackDirectMessageStepInput, SendSlackDirectMessageStepOutput, SessionContext, SetGmailReadStatusStepInput, SetGmailReadStatusStepOutput, SetRunTitleStepInput, SetRunTitleStepOutput, SetVariableStepInput, SetVariableStepOutput, StepCostEstimateEntry, StepExecutionMeta, StepExecutionOptions, StepExecutionResult, StepInputMap, StepLogEvent, StepMetadata, StepMethods, StepName, StepOutputMap, StoredFile, SystemFields, TaskEvent, TaskToolCall, TaskToolConfig, TaskUsage, TextToSpeechStepInput, TextToSpeechStepOutput, TopSource, TranscribeAudioStepInput, TranscribeAudioStepOutput, TrimMediaStepInput, TrimMediaStepOutput, TypesafeEvaluateStepInput, TypesafeEvaluateStepOutput, UpdateGmailLabelsStepInput, UpdateGmailLabelsStepOutput, UpdateGoogleCalendarEventStepInput, UpdateGoogleCalendarEventStepOutput, UpdateGoogleDocStepInput, UpdateGoogleDocStepOutput, UpdateGoogleSheetStepInput, UpdateGoogleSheetStepOutput, UpdateInput, UploadDataSourceDocumentStepInput, UploadDataSourceDocumentStepOutput, UploadFileResult, UploadToken, UpscaleImageStepInput, UpscaleImageStepOutput, UpscaleVideoStepInput, UpscaleVideoStepOutput, User, UserInfoResult, UserMessageStepInput, UserMessageStepOutput, VideoFaceSwapStepInput, VideoFaceSwapStepOutput, VideoRemoveBackgroundStepInput, VideoRemoveBackgroundStepOutput, VideoRemoveWatermarkStepInput, VideoRemoveWatermarkStepOutput, Voice, VoiceCallResult, WatermarkImageStepInput, WatermarkImageStepOutput, WatermarkVideoStepInput, WatermarkVideoStepOutput, YouDotComFinanceResearchStepInput, YouDotComFinanceResearchStepOutput, YouDotComGetPageContentStepInput, YouDotComGetPageContentStepOutput, YouDotComLiveNewsStepInput, YouDotComLiveNewsStepOutput, YouDotComWebResearchStepInput, YouDotComWebResearchStepOutput, YouDotComWebSearchStepInput, YouDotComWebSearchStepOutput };
|
|
13030
|
+
export type { Accessor, ActiveCampaignAddNoteStepInput, ActiveCampaignAddNoteStepOutput, ActiveCampaignCreateContactStepInput, ActiveCampaignCreateContactStepOutput, AddSubtitlesToVideoStepInput, AddSubtitlesToVideoStepOutput, AddThumbnailToVideoStepInput, AddThumbnailToVideoStepOutput, AgentInfo, AgentOptions, AggregateRow, AggregateSelect, AggregateTerm, AiSourceVendor, AirtableCreateUpdateRecordStepInput, AirtableCreateUpdateRecordStepOutput, AirtableDeleteRecordStepInput, AirtableDeleteRecordStepOutput, AirtableGetRecordStepInput, AirtableGetRecordStepOutput, AirtableGetTableRecordsStepInput, AirtableGetTableRecordsStepOutput, Analytics, AnalyticsDateRange, AnalyticsDimension, AnalyticsFilter, AnalyticsFilterOp, AnalyticsGranularity, AnalyticsMetric, AnalyticsQueryResponse, AnalyticsQueryResultRow, AnalyticsQuerySpec, AnalyticsReadOptions, AnalyzeImageStepInput, AnalyzeImageStepOutput, AnalyzeVideoStepInput, AnalyzeVideoStepOutput, AppAuthContext, AppContextResult, AppDatabase, AppDatabaseColumnSchema, AppDatabaseTable, AppRoleAssignment, AuthTableConfig, BatchStepInput, BatchStepResult, Batchable, CaptureThumbnailStepInput, CaptureThumbnailStepOutput, CheckAppRoleStepInput, CheckAppRoleStepOutput, CodaCreateUpdatePageStepInput, CodaCreateUpdatePageStepOutput, CodaCreateUpdateRowStepInput, CodaCreateUpdateRowStepOutput, CodaFindRowStepInput, CodaFindRowStepOutput, CodaGetPageStepInput, CodaGetPageStepOutput, CodaGetTableRowsStepInput, CodaGetTableRowsStepOutput, Connection, ConnectorActionDetail, ConnectorService, ConvertPdfToImagesStepInput, ConvertPdfToImagesStepOutput, CrawlerBucket, CrawlerHit, CrawlerOverview, CreateDataSourceStepInput, CreateDataSourceStepOutput, CreateGmailDraftStepInput, CreateGmailDraftStepOutput, CreateGoogleCalendarEventStepInput, CreateGoogleCalendarEventStepOutput, CreateGoogleDocStepInput, CreateGoogleDocStepOutput, CreateGoogleSheetStepInput, CreateGoogleSheetStepOutput, Db, DecomposeImageStepInput, DecomposeImageStepOutput, DefineStoreOptions, DefineTableOptions, DeleteDataSourceDocumentStepInput, DeleteDataSourceDocumentStepOutput, DeleteDataSourceStepInput, DeleteDataSourceStepOutput, DeleteGmailEmailStepInput, DeleteGmailEmailStepOutput, DeleteGoogleCalendarEventStepInput, DeleteGoogleCalendarEventStepOutput, DeleteGoogleSheetRowsStepInput, DeleteGoogleSheetRowsStepOutput, DetectChangesStepInput, DetectChangesStepOutput, DetectPIIStepInput, DetectPIIStepOutput, DownloadVideoStepInput, DownloadVideoStepOutput, EnhanceImageGenerationPromptStepInput, EnhanceImageGenerationPromptStepOutput, EnhanceVideoGenerationPromptStepInput, EnhanceVideoGenerationPromptStepOutput, EnrichPersonStepInput, EnrichPersonStepOutput, EvaluateDecisionStepInput, EvaluateDecisionStepOutput, EventGrantOptions, EventGrantResult, Events, ExecuteStepBatchOptions, ExecuteStepBatchResult, ExtractAudioFromVideoStepInput, ExtractAudioFromVideoStepOutput, ExtractTextStepInput, ExtractTextStepOutput, FetchDataSourceDocumentStepInput, FetchDataSourceDocumentStepOutput, FetchGoogleDocStepInput, FetchGoogleDocStepOutput, FetchGoogleSheetStepInput, FetchGoogleSheetStepOutput, FetchSlackChannelHistoryStepInput, FetchSlackChannelHistoryStepOutput, FetchYoutubeCaptionsStepInput, FetchYoutubeCaptionsStepOutput, FetchYoutubeChannelStepInput, FetchYoutubeChannelStepOutput, FetchYoutubeCommentsStepInput, FetchYoutubeCommentsStepOutput, FetchYoutubeVideoStepInput, FetchYoutubeVideoStepOutput, FileAccess, Files, FromSchema, Generate3dModelStepInput, Generate3dModelStepOutput, GenerateAssetStepInput, GenerateAssetStepOutput, GenerateImageStepInput, GenerateImageStepOutput, GenerateLipsyncStepInput, GenerateLipsyncStepOutput, GenerateMusicStepInput, GenerateMusicStepOutput, GeneratePdfStepInput, GeneratePdfStepOutput, GenerateSoundStepInput, GenerateSoundStepOutput, GenerateStaticVideoFromImageStepInput, GenerateStaticVideoFromImageStepOutput, GenerateTextStepInput, GenerateTextStepOutput, GenerateVideoStepInput, GenerateVideoStepOutput, GetGmailAttachmentsStepInput, GetGmailAttachmentsStepOutput, GetGmailDraftStepInput, GetGmailDraftStepOutput, GetGmailEmailStepInput, GetGmailEmailStepOutput, GetGmailUnreadCountStepInput, GetGmailUnreadCountStepOutput, GetGoogleCalendarEventStepInput, GetGoogleCalendarEventStepOutput, GetGoogleDriveFileStepInput, GetGoogleDriveFileStepOutput, GetGoogleSheetInfoStepInput, GetGoogleSheetInfoStepOutput, GetMediaMetadataStepInput, GetMediaMetadataStepOutput, GetStreamOptions, HttpResponseFile, HttpResponseHeaders, HttpResponseInit, HttpResponseOptions, HubspotCreateCompanyStepInput, HubspotCreateCompanyStepOutput, HubspotCreateContactStepInput, HubspotCreateContactStepOutput, HubspotGetCompanyStepInput, HubspotGetCompanyStepOutput, HubspotGetContactStepInput, HubspotGetContactStepOutput, HunterApiCompanyEnrichmentStepInput, HunterApiCompanyEnrichmentStepOutput, HunterApiDomainSearchStepInput, HunterApiDomainSearchStepOutput, HunterApiEmailFinderStepInput, HunterApiEmailFinderStepOutput, HunterApiEmailVerificationStepInput, HunterApiEmailVerificationStepOutput, HunterApiPersonEnrichmentStepInput, HunterApiPersonEnrichmentStepOutput, ImageFaceSwapStepInput, ImageFaceSwapStepOutput, ImageRemoveWatermarkStepInput, ImageRemoveWatermarkStepOutput, ImportFromUrlStepInput, ImportFromUrlStepOutput, InsertVideoClipsStepInput, InsertVideoClipsStepOutput, Jewel, JewelConfig, JewelGradeContext, JewelMethod, JewelMethodInput, JewelPairRecord, JewelProposal, JewelProposeOutcome, JewelProposeResult, JewelQueueItem, JewelQueueResolution, JewelQueueResolveResult, JewelRunParams, JewelVerdict, JewelsApi, JsonObjectSchema, JsonSchema, JsonSchemaTypeName, ListAgentsResult, ListDataSourcesStepInput, ListDataSourcesStepOutput, ListGmailDraftsStepInput, ListGmailDraftsStepOutput, ListGmailLabelsStepInput, ListGmailLabelsStepOutput, ListGoogleCalendarEventsStepInput, ListGoogleCalendarEventsStepOutput, ListGoogleDriveFilesStepInput, ListGoogleDriveFilesStepOutput, ListOptions, ListRecentGmailEmailsStepInput, ListRecentGmailEmailsStepOutput, LiveNow, LogicStepInput, LogicStepOutput, MakeDotComRunScenarioStepInput, MakeDotComRunScenarioStepOutput, MapObject, MapOutcome, MapPoint, MapRunObject, MapRunOutcome, MapRunParams, MapRunRecord, MapRunResult, MappedDocument, Mapper, MapperConfig, MergeAudioStepInput, MergeAudioStepOutput, MergeVideosStepInput, MergeVideosStepOutput, MeshyAnimateStepInput, MeshyAnimateStepOutput, MeshyImageTo3dStepInput, MeshyImageTo3dStepOutput, MeshyRemeshStepInput, MeshyRemeshStepOutput, MeshyRigStepInput, MeshyRigStepOutput, MeshyTextTo3dStepInput, MeshyTextTo3dStepOutput, MeshyTextureStepInput, MeshyTextureStepOutput, MindStudioModel, MindStudioModelSummary, MixAudioIntoVideoStepInput, MixAudioIntoVideoStepOutput, ModelType, MonacoSnippet, MonacoSnippetField, MonacoSnippetFieldType, MuteVideoStepInput, MuteVideoStepOutput, N8nRunNodeStepInput, N8nRunNodeStepOutput, NotionCreatePageStepInput, NotionCreatePageStepOutput, NotionUpdatePageStepInput, NotionUpdatePageStepOutput, PackagedWorkflow, PackagedWorkflowInput, PackagedWorkflowSignature, PeopleSearchStepInput, PeopleSearchStepOutput, PostToLinkedInStepInput, PostToLinkedInStepOutput, PostToSlackChannelStepInput, PostToSlackChannelStepOutput, PostToXStepInput, PostToXStepOutput, PostToZapierStepInput, PostToZapierStepOutput, Predicate, PushInput, PutOptions, PutStream, QueryDataSourceStepInput, QueryDataSourceStepOutput, QueryExternalDatabaseStepInput, QueryExternalDatabaseStepOutput, QuickbooksApiRequestStepInput, QuickbooksApiRequestStepOutput, ReadDelivery, ReadRunParams, ReadRunRecord, ReadRunResult, Reader, ReaderConfig, ReaderDocument, RedactPIIStepInput, RedactPIIStepOutput, RemoveBackgroundFromImageStepInput, RemoveBackgroundFromImageStepOutput, RenderVideoFromHtmlCompositionStepInput, RenderVideoFromHtmlCompositionStepOutput, ReplyToGmailEmailStepInput, ReplyToGmailEmailStepOutput, ReportIssueInput, ReportedIssue, RequestContext, ResizeVideoStepInput, ResizeVideoStepOutput, ResolvedUser, RunAgentOptions, RunAgentResult, RunFfmpegStepInput, RunFfmpegStepOutput, RunFromConnectorRegistryStepInput, RunFromConnectorRegistryStepOutput, RunTaskOptions, RunTaskOptionsWithExample, RunTaskOptionsWithSchema, RunTaskResult, SchemaValidationError, ScrapeLinkedInCompanyStepInput, ScrapeLinkedInCompanyStepOutput, ScrapeLinkedInProfileStepInput, ScrapeLinkedInProfileStepOutput, ScrapeUrlStepInput, ScrapeUrlStepOutput, ScrapeXPostStepInput, ScrapeXPostStepOutput, ScrapeXProfileStepInput, ScrapeXProfileStepOutput, ScreenshotUrlStepInput, ScreenshotUrlStepOutput, SearchGmailEmailsStepInput, SearchGmailEmailsStepOutput, SearchGoogleCalendarEventsStepInput, SearchGoogleCalendarEventsStepOutput, SearchGoogleDriveStepInput, SearchGoogleDriveStepOutput, SearchGoogleImagesStepInput, SearchGoogleImagesStepOutput, SearchGoogleNewsStepInput, SearchGoogleNewsStepOutput, SearchGoogleStepInput, SearchGoogleStepOutput, SearchGoogleTrendsStepInput, SearchGoogleTrendsStepOutput, SearchPerplexityStepInput, SearchPerplexityStepOutput, SearchXPostsStepInput, SearchXPostsStepOutput, SearchYoutubeStepInput, SearchYoutubeStepOutput, SearchYoutubeTrendsStepInput, SearchYoutubeTrendsStepOutput, SendEmailStepInput, SendEmailStepOutput, SendGmailDraftStepInput, SendGmailDraftStepOutput, SendGmailMessageStepInput, SendGmailMessageStepOutput, SendSMSStepInput, SendSMSStepOutput, SendSlackDirectMessageStepInput, SendSlackDirectMessageStepOutput, SessionContext, SetGmailReadStatusStepInput, SetGmailReadStatusStepOutput, SetRunTitleStepInput, SetRunTitleStepOutput, SetVariableStepInput, SetVariableStepOutput, SettableSystemColumns, StepCostEstimateEntry, StepExecutionMeta, StepExecutionOptions, StepExecutionResult, StepInputMap, StepLogEvent, StepMetadata, StepMethods, StepName, StepOutputMap, StoredFile, SystemFields, TaskEvent, TaskToolCall, TaskToolConfig, TaskUsage, TextToSpeechStepInput, TextToSpeechStepOutput, TopSource, TranscribeAudioStepInput, TranscribeAudioStepOutput, TrimMediaStepInput, TrimMediaStepOutput, TypesafeEvaluateStepInput, TypesafeEvaluateStepOutput, UpdateGmailLabelsStepInput, UpdateGmailLabelsStepOutput, UpdateGoogleCalendarEventStepInput, UpdateGoogleCalendarEventStepOutput, UpdateGoogleDocStepInput, UpdateGoogleDocStepOutput, UpdateGoogleSheetStepInput, UpdateGoogleSheetStepOutput, UpdateInput, UploadDataSourceDocumentStepInput, UploadDataSourceDocumentStepOutput, UploadFileResult, UploadToken, UpscaleImageStepInput, UpscaleImageStepOutput, UpscaleVideoStepInput, UpscaleVideoStepOutput, User, UserInfoResult, UserMessageStepInput, UserMessageStepOutput, VideoFaceSwapStepInput, VideoFaceSwapStepOutput, VideoRemoveBackgroundStepInput, VideoRemoveBackgroundStepOutput, VideoRemoveWatermarkStepInput, VideoRemoveWatermarkStepOutput, Voice, VoiceCallResult, WatermarkImageStepInput, WatermarkImageStepOutput, WatermarkVideoStepInput, WatermarkVideoStepOutput, YouDotComFinanceResearchStepInput, YouDotComFinanceResearchStepOutput, YouDotComGetPageContentStepInput, YouDotComGetPageContentStepOutput, YouDotComLiveNewsStepInput, YouDotComLiveNewsStepOutput, YouDotComWebResearchStepInput, YouDotComWebResearchStepOutput, YouDotComWebSearchStepInput, YouDotComWebSearchStepOutput };
|
package/dist/index.js
CHANGED
|
@@ -573,7 +573,8 @@ function serializeParam(val) {
|
|
|
573
573
|
}
|
|
574
574
|
function serializeColumnParam(val, columnName, columns) {
|
|
575
575
|
const col = columnsByName(columns).get(columnName);
|
|
576
|
-
|
|
576
|
+
const isUserColumn = col?.type === "user" || columnName === "last_updated_by";
|
|
577
|
+
if (isUserColumn && typeof val === "string") {
|
|
577
578
|
return val.startsWith(USER_PREFIX) ? val : `${USER_PREFIX}${val}`;
|
|
578
579
|
}
|
|
579
580
|
return serializeParam(val);
|
|
@@ -771,7 +772,7 @@ function buildExists(table, where, whereParams, negate) {
|
|
|
771
772
|
};
|
|
772
773
|
}
|
|
773
774
|
function buildInsert(table, data, columns) {
|
|
774
|
-
const filtered =
|
|
775
|
+
const filtered = stripPlatformColumns(data);
|
|
775
776
|
const keys = Object.keys(filtered);
|
|
776
777
|
const placeholders = keys.map(() => "?").join(", ");
|
|
777
778
|
const params = keys.map((k) => serializeColumnParam(filtered[k], k, columns));
|
|
@@ -781,7 +782,7 @@ function buildInsert(table, data, columns) {
|
|
|
781
782
|
};
|
|
782
783
|
}
|
|
783
784
|
function buildUpdate(table, id, data, columns) {
|
|
784
|
-
const filtered =
|
|
785
|
+
const filtered = stripPlatformColumns(data);
|
|
785
786
|
const keys = Object.keys(filtered);
|
|
786
787
|
const assignments = keys.map((k) => `${k} = ?`).join(", ");
|
|
787
788
|
const params = [
|
|
@@ -795,7 +796,7 @@ function buildUpdate(table, id, data, columns) {
|
|
|
795
796
|
};
|
|
796
797
|
}
|
|
797
798
|
function buildUpsert(table, data, conflictColumns, columns) {
|
|
798
|
-
const filtered =
|
|
799
|
+
const filtered = stripPlatformColumns(data);
|
|
799
800
|
const keys = Object.keys(filtered);
|
|
800
801
|
const placeholders = keys.map(() => "?").join(", ");
|
|
801
802
|
const params = keys.map((k) => serializeColumnParam(filtered[k], k, columns));
|
|
@@ -811,19 +812,16 @@ function buildDelete(table, where, whereParams) {
|
|
|
811
812
|
}
|
|
812
813
|
return { sql, params: whereParams?.length ? whereParams : void 0 };
|
|
813
814
|
}
|
|
814
|
-
var
|
|
815
|
+
var PLATFORM_COLUMNS = /* @__PURE__ */ new Set([
|
|
815
816
|
"id",
|
|
816
|
-
"created_at",
|
|
817
817
|
"createdAt",
|
|
818
|
-
"updated_at",
|
|
819
818
|
"updatedAt",
|
|
820
|
-
"last_updated_by",
|
|
821
819
|
"lastUpdatedBy"
|
|
822
820
|
]);
|
|
823
|
-
function
|
|
821
|
+
function stripPlatformColumns(data) {
|
|
824
822
|
const result = {};
|
|
825
823
|
for (const [key, value] of Object.entries(data)) {
|
|
826
|
-
if (!
|
|
824
|
+
if (!PLATFORM_COLUMNS.has(key)) {
|
|
827
825
|
result[key] = value;
|
|
828
826
|
}
|
|
829
827
|
}
|
|
@@ -2546,7 +2544,7 @@ var Table = class {
|
|
|
2546
2544
|
(item) => this._config.defaults ? { ...this._config.defaults, ...item } : item
|
|
2547
2545
|
);
|
|
2548
2546
|
const build = () => items.map((item) => {
|
|
2549
|
-
this.
|
|
2547
|
+
this._checkApiKeyWrite(item);
|
|
2550
2548
|
return buildInsert(
|
|
2551
2549
|
this._config.tableName,
|
|
2552
2550
|
item,
|
|
@@ -2575,10 +2573,13 @@ var Table = class {
|
|
|
2575
2573
|
/**
|
|
2576
2574
|
* Update a row by ID. Only the provided fields are changed.
|
|
2577
2575
|
* Returns the updated row via `UPDATE ... RETURNING *`.
|
|
2576
|
+
*
|
|
2577
|
+
* The platform advances `updated_at` and stamps `last_updated_by` with the
|
|
2578
|
+
* signed-in user unless the data changes them itself.
|
|
2578
2579
|
*/
|
|
2579
2580
|
update(id, data) {
|
|
2580
2581
|
const build = () => {
|
|
2581
|
-
this.
|
|
2582
|
+
this._checkApiKeyWrite(data);
|
|
2582
2583
|
return [
|
|
2583
2584
|
buildUpdate(this._config.tableName, id, data, this._config.columns)
|
|
2584
2585
|
];
|
|
@@ -2670,6 +2671,8 @@ var Table = class {
|
|
|
2670
2671
|
* @param conflictKey - Column name(s) that form the unique constraint.
|
|
2671
2672
|
* Pass a single string for single-column unique, or an array for compound.
|
|
2672
2673
|
* @param data - Row data to insert (or update on conflict). Defaults apply.
|
|
2674
|
+
* A `created_at`, `updated_at` or `last_updated_by` it gives is written
|
|
2675
|
+
* either way; whichever it leaves out the platform fills in.
|
|
2673
2676
|
*/
|
|
2674
2677
|
upsert(conflictKey, data) {
|
|
2675
2678
|
const conflictColumns = Array.isArray(conflictKey) ? conflictKey : [conflictKey];
|
|
@@ -2685,7 +2688,7 @@ var Table = class {
|
|
|
2685
2688
|
}
|
|
2686
2689
|
}
|
|
2687
2690
|
const build = () => {
|
|
2688
|
-
this.
|
|
2691
|
+
this._checkApiKeyWrite(withDefaults);
|
|
2689
2692
|
return [
|
|
2690
2693
|
buildUpsert(
|
|
2691
2694
|
this._config.tableName,
|
|
@@ -2714,22 +2717,19 @@ var Table = class {
|
|
|
2714
2717
|
// -------------------------------------------------------------------------
|
|
2715
2718
|
// Internal helpers
|
|
2716
2719
|
// -------------------------------------------------------------------------
|
|
2717
|
-
/**
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
400
|
|
2731
|
-
);
|
|
2732
|
-
}
|
|
2720
|
+
/**
|
|
2721
|
+
* @internal Throw if data writes the auth table's API key column, which holds
|
|
2722
|
+
* the masked key the platform issued. The other mapped columns are the app's
|
|
2723
|
+
* to write.
|
|
2724
|
+
*/
|
|
2725
|
+
_checkApiKeyWrite(data) {
|
|
2726
|
+
const column = this._config.managedColumns?.apiKey;
|
|
2727
|
+
if (column && Object.keys(data).includes(column)) {
|
|
2728
|
+
throw new MindStudioError(
|
|
2729
|
+
`Cannot write to "${column}" \u2014 this column is managed by auth. Use the auth API to issue or revoke a user's API key.`,
|
|
2730
|
+
"managed_column_write",
|
|
2731
|
+
400
|
|
2732
|
+
);
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
2735
|
/**
|
|
@@ -4576,7 +4576,7 @@ var stepMetadata = {
|
|
|
4576
4576
|
"evaluateDecision": {
|
|
4577
4577
|
stepType: "evaluateDecision",
|
|
4578
4578
|
description: "Ask structured questions about text, JSON, or images and get calibrated answers from a decision model. The model returns a probability, a selected option, or a score. It does not write a reply. Each question is a noul (yes or no, as a probability from 0 to 1), a choice (one option from a set you define, with a probability for each), or a score (a rating against ordered levels). Put every question in the same call. The question id is yours: answers come back under the same ids. The model defaults to Jev (jev-latest).",
|
|
4579
|
-
usageNotes: "- state is the content to judge: a string, or a JSON object or array (a record, a chat log, application state).\n- questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.\n- A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.\n- A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.\n- A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.\n- An answer of type refusal means the model declined that question (GPT-6 Luna Decisions can).\n- instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.\n- Send every question you need in one call. The model reads the state once and answers them together.\n- Probabilities from different models are not comparable: tune a threshold against the model, and the version, it will run on.\n- decisionModelOverride.model picks the model:\n - jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.\n - clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.\n - mercury-decide runs Inception's Mercury Decide, which reads up to 64k tokens and up to 16 PNG, JPEG, WebP, or GIF images, each at most 10 MiB and 14 MiB together.\n - gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.\n- images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.\n- The response model field is the version that answered.\n- Billed per input token. Output tokens are free. Each model has its own rate, and GPT-6 Luna Decisions bills a prompt over 272k tokens at twice its rate.",
|
|
4579
|
+
usageNotes: "- state is the content to judge: a string, or a JSON object or array (a record, a chat log, application state).\n- questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.\n- A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.\n- A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.\n- A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.\n- An answer of type refusal means the model declined that question (GPT-6 Luna Decisions can).\n- instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.\n- Send every question you need in one call. The model reads the state once and answers them together.\n- Probabilities from different models are not comparable: tune a threshold against the model, and the version, it will run on.\n- decisionModelOverride.model picks the model:\n - jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.\n - clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.\n - mercury-decide runs Inception's Mercury Decide, which reads up to 64k tokens and up to 16 PNG, JPEG, WebP, or GIF images, each at most 10 MiB and 14 MiB together.\n - drex-max, drex-v2.0 and drex-v1.5 run Nace.AI's Drex, served by DeepInfra, and take at most 16 questions. drex-max reads up to 262k tokens and up to 4 PNG, JPEG, WebP, or GIF images, 9 MiB together. drex-v2.0 and drex-v1.5 read text only, up to 128k tokens. nace-ai/drex-max, nace-ai/drex-v2.0 and nace-ai/drex-v1.5 name the same three.\n - gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.\n- images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.\n- The response model field is the version that answered.\n- Billed per input token. Output tokens are free. Each model has its own rate, and GPT-6 Luna Decisions bills a prompt over 272k tokens at twice its rate.",
|
|
4580
4580
|
inputSchema: { "type": "object", "properties": { "state": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": {}, "required": [] }, { "type": "array", "items": {} }] }, "questions": { "type": "object", "properties": {}, "required": [], "description": "Questions to ask about the state, keyed by an id you choose." }, "images": { "type": "array", "items": { "type": "string" }, "description": "Images for a model that reads them (Clef, Clef Flash, GPT-6 Luna Decisions). Each entry is a URL or a data URL. A model that reads none refuses the call." }, "decisionModelOverride": { "type": "object", "properties": { "model": { "type": "string", "description": "Decision model: a catalog id, its vendor's name for it (`@cf/cloudflare/clef`, `gpt-6-luna`), or a version it pins (`jev-1.13.0`)" }, "config": { "type": "object", "properties": {}, "required": [], "description": "Additional model-specific configuration" } }, "required": ["model"], "description": "Optional model override. Uses the workspace's default decision model (Jev) if not specified" } }, "required": ["state", "questions"] },
|
|
4581
4581
|
outputSchema: { "type": "object", "properties": { "model": { "type": "string", "description": "Versioned model id that answered, such as jev-1.13.0." }, "answers": { "type": "object", "properties": {}, "required": [], "description": "One answer per question, under the same ids." }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "number" }, "output_tokens": { "type": "number" } }, "required": ["input_tokens", "output_tokens"], "description": "Token counts for the call. Input tokens are what the model bills." } }, "required": ["model", "answers", "usage"] }
|
|
4582
4582
|
},
|