sim 2.1.4-preview.63.1 → 2.1.4
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/index.js +62 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8263,6 +8263,37 @@ var V2_OPERATIONS = {
|
|
|
8263
8263
|
}
|
|
8264
8264
|
}
|
|
8265
8265
|
},
|
|
8266
|
+
executeTool: {
|
|
8267
|
+
method: "POST",
|
|
8268
|
+
path: "/api/v2/tools/[toolId]/execute",
|
|
8269
|
+
pathParams: ["toolId"],
|
|
8270
|
+
pathParamDocs: {
|
|
8271
|
+
toolId: "Tool identifier. An unversioned name resolves to the newest version, and the response echoes the resolved id."
|
|
8272
|
+
},
|
|
8273
|
+
responseMode: "json",
|
|
8274
|
+
summary: "Run Tool",
|
|
8275
|
+
personalKeyOnly: true,
|
|
8276
|
+
body: {
|
|
8277
|
+
workspaceId: {
|
|
8278
|
+
kind: "string",
|
|
8279
|
+
required: true,
|
|
8280
|
+
describe: "Workspace whose integration allowlist, credentials, and environment variables govern this call."
|
|
8281
|
+
},
|
|
8282
|
+
input: {
|
|
8283
|
+
kind: "object",
|
|
8284
|
+
default: {},
|
|
8285
|
+
describe: "Arguments for the tool, keyed by the parameter ids the tool catalog publishes for it. A parameter whose visibility is `user-only` also accepts an environment-variable reference written as the whole value, `{{VAR_NAME}}`, resolved server-side against the workspace environment; any other value is sent verbatim."
|
|
8286
|
+
},
|
|
8287
|
+
credentialId: {
|
|
8288
|
+
kind: "string",
|
|
8289
|
+
describe: "Credential to authenticate with. Required when the tool declares an OAuth requirement; the workspace credentials list names the candidates."
|
|
8290
|
+
},
|
|
8291
|
+
timeoutSeconds: {
|
|
8292
|
+
kind: "integer",
|
|
8293
|
+
describe: "How long to wait for the tool before abandoning the call."
|
|
8294
|
+
}
|
|
8295
|
+
}
|
|
8296
|
+
},
|
|
8266
8297
|
executeWorkflow: {
|
|
8267
8298
|
method: "POST",
|
|
8268
8299
|
path: "/api/v2/workflows/[workflowId]/execute",
|
|
@@ -8947,7 +8978,8 @@ var V2_OPERATIONS = {
|
|
|
8947
8978
|
"knowledge-base",
|
|
8948
8979
|
"voice-input",
|
|
8949
8980
|
"enrichment",
|
|
8950
|
-
"voice-output"
|
|
8981
|
+
"voice-output",
|
|
8982
|
+
"api-tool"
|
|
8951
8983
|
],
|
|
8952
8984
|
describe: "Restrict results to one usage source."
|
|
8953
8985
|
},
|
|
@@ -13025,6 +13057,24 @@ var CLI_CONTRACT = {
|
|
|
13025
13057
|
describe: "Print a workflow as a portable JSON document",
|
|
13026
13058
|
document: true
|
|
13027
13059
|
},
|
|
13060
|
+
executeTool: {
|
|
13061
|
+
command: "tools execute",
|
|
13062
|
+
describe: "Run one built-in tool and print what it produced",
|
|
13063
|
+
flags: {
|
|
13064
|
+
input: {
|
|
13065
|
+
json: true,
|
|
13066
|
+
describe: "Tool arguments as JSON, keyed by the parameter ids `sim tools get <toolId>` lists"
|
|
13067
|
+
},
|
|
13068
|
+
credentialId: { describe: "Credential to authenticate with, required for OAuth tools" },
|
|
13069
|
+
timeoutSeconds: { name: "timeout", describe: "Seconds to wait before abandoning the call" }
|
|
13070
|
+
},
|
|
13071
|
+
fields: [
|
|
13072
|
+
{ path: "toolId", header: "Tool" },
|
|
13073
|
+
{ path: "status", header: "Status" },
|
|
13074
|
+
{ path: "output", header: "Output" },
|
|
13075
|
+
{ path: "error.message", header: "Error" }
|
|
13076
|
+
]
|
|
13077
|
+
},
|
|
13028
13078
|
executeWorkflow: {
|
|
13029
13079
|
command: "workflows run",
|
|
13030
13080
|
describe: "Run a deployed workflow or execute saved state manually",
|
|
@@ -13939,20 +13989,25 @@ function renderResult(operation, format, raw, spec, options = {}, envelope) {
|
|
|
13939
13989
|
}
|
|
13940
13990
|
|
|
13941
13991
|
// src/runtime/execute.ts
|
|
13942
|
-
var RUN_OUTCOME_OPERATIONS =
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
|
|
13992
|
+
var RUN_OUTCOME_OPERATIONS = {
|
|
13993
|
+
executeWorkflow: {
|
|
13994
|
+
failed: "The workflow run failed.",
|
|
13995
|
+
cancelled: "The workflow run was cancelled."
|
|
13996
|
+
},
|
|
13997
|
+
executeTool: {
|
|
13998
|
+
failed: "The tool call failed."
|
|
13999
|
+
}
|
|
13946
14000
|
};
|
|
13947
14001
|
function runFailureMessage(operation, payload) {
|
|
13948
|
-
|
|
14002
|
+
const failureMessages = RUN_OUTCOME_OPERATIONS[operation];
|
|
14003
|
+
if (!failureMessages)
|
|
13949
14004
|
return null;
|
|
13950
14005
|
if (!payload || typeof payload !== "object" || Array.isArray(payload))
|
|
13951
14006
|
return null;
|
|
13952
14007
|
const { status, error } = payload;
|
|
13953
14008
|
if (typeof status !== "string")
|
|
13954
14009
|
return null;
|
|
13955
|
-
const fallback =
|
|
14010
|
+
const fallback = failureMessages[status];
|
|
13956
14011
|
if (!fallback)
|
|
13957
14012
|
return null;
|
|
13958
14013
|
const reported2 = error?.message;
|