Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import strale from "../../strale.app.mjs";

export default {
name: "Execute Capability",
version: "0.0.1",
key: "strale-execute-capability",
description: "Execute a specific Strale capability by slug with the provided inputs. Returns structured data with quality score and audit trail. [See the documentation](https://strale.dev)",
Comment thread
michelle0927 marked this conversation as resolved.
type: "action",
annotations: {
readOnlyHint: false,
destructiveHint: false,
openWorldHint: true,
},
props: {
Comment thread
michelle0927 marked this conversation as resolved.
strale,
capabilitySlug: {
propDefinition: [
strale,
"capabilitySlug",
],
},
inputs: {
propDefinition: [
strale,
"inputs",
],
},
maxPriceCents: {
propDefinition: [
strale,
"maxPriceCents",
],
},
dryRun: {
propDefinition: [
strale,
"dryRun",
],
},
},
async run({ $ }) {
const data = {
capability_slug: this.capabilitySlug,
inputs: this.inputs,
max_price_cents: this.maxPriceCents,
};

if (this.dryRun) {
data.dry_run = true;
}

const response = await this.strale.execute({
$,
data,
});

if (this.dryRun) {
$.export("$summary", `Dry run matched capability "${response.capability?.slug ?? this.capabilitySlug}"`);
} else {
$.export("$summary", `Successfully executed "${this.capabilitySlug}" (transaction: ${response?.result?.transaction_id ?? "n/a"})`);
}

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import strale from "../../strale.app.mjs";

export default {
name: "Search and Execute",
version: "0.0.1",
key: "strale-search-and-execute",
description: "Describe what you need in plain language, and Strale finds the best-matching capability and executes it. Combines search (POST /v1/suggest) and execution (POST /v1/do) in one step. [See the documentation](https://strale.dev)",
Comment thread
michelle0927 marked this conversation as resolved.
type: "action",
annotations: {
readOnlyHint: false,
destructiveHint: false,
openWorldHint: true,
},
props: {
Comment thread
michelle0927 marked this conversation as resolved.
strale,
task: {
propDefinition: [
strale,
"task",
],
},
inputs: {
propDefinition: [
strale,
"inputs",
],
optional: true,
},
maxPriceCents: {
propDefinition: [
strale,
"maxPriceCents",
],
},
dryRun: {
propDefinition: [
strale,
"dryRun",
],
},
},
async run({ $ }) {
const data = {
task: this.task,
inputs: this.inputs ?? {},
max_price_cents: this.maxPriceCents,
};

if (this.dryRun) {
data.dry_run = true;
const response = await this.strale.execute({
$,
data,
});
$.export("$summary", `Dry run completed for "${this.task}"`);
return response;
Comment thread
michelle0927 marked this conversation as resolved.
}

const response = await this.strale.execute({
$,
data,
});

$.export("$summary", `Executed "${this.task}" (transaction: ${response?.result?.transaction_id ?? "n/a"})`);

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import strale from "../../strale.app.mjs";

export default {
name: "Search Capabilities",
version: "0.0.1",
key: "strale-search-capabilities",
description: "Search Strale's catalog of 290+ data capabilities using natural language. Returns matching capabilities with prices and quality scores. [See the documentation](https://strale.dev)",
type: "action",
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
},
props: {
Comment thread
michelle0927 marked this conversation as resolved.
strale,
task: {
propDefinition: [
strale,
"task",
],
},
limit: {
propDefinition: [
strale,
"limit",
],
},
},
async run({ $ }) {
const response = await this.strale.suggest({
$,
data: {
query: this.task,
limit: this.limit ?? 5,
},
});

$.export("$summary", `Successfully searched for matching capabilities for "${this.task}"`);

return response;
},
};
7 changes: 5 additions & 2 deletions components/strale/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/strale",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Strale Components",
"main": "strale.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.1.1"
}
}
}
97 changes: 92 additions & 5 deletions components/strale/strale.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,98 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "strale",
propDefinitions: {},
description: "Strale is the data layer for AI agents — 290+ quality-tested data capabilities including company verification, sanctions screening, VAT validation, invoice extraction, and more. [See the documentation](https://strale.dev)",
propDefinitions: {
task: {
type: "string",
label: "Task",
description: "A natural-language description of what you need (e.g. \"verify a Swedish company\", \"validate this VAT number\").",
},
capabilitySlug: {
type: "string",
label: "Capability Slug",
description: "The slug of the capability to execute (e.g. `swedish-company-data`, `vat-validate`, `email-validate`). [See the catalog](https://strale.dev).",
},
inputs: {
type: "object",
label: "Inputs",
description: "Input parameters for the capability as a JSON object (e.g. `{ \"vat_number\": \"SE556677889901\" }` or `{ \"email\": \"ops@example.com\" }`). The required fields depend on the capability being called.",
},
Comment thread
michelle0927 marked this conversation as resolved.
limit: {
type: "integer",
label: "Limit",
description: "Maximum number of results to return.",
optional: true,
default: 5,
},
maxPriceCents: {
type: "integer",
label: "Max Price (cents)",
description: "Maximum price in euro cents you are willing to pay per execution.",
},
Comment thread
michelle0927 marked this conversation as resolved.
dryRun: {
type: "boolean",
label: "Dry Run",
description: "If `true`, validates the request and returns the matched capability without executing or charging.",
optional: true,
default: false,
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_apiKey() {
return this.$auth.api_key;
},
_baseUrl() {
return "https://api.strale.io";
},
_headers() {
const headers = {
"Content-Type": "application/json",
};
const apiKey = this._apiKey();
if (apiKey) {
headers["Authorization"] = `Bearer ${apiKey}`;
}
return headers;
},
_makeRequest({
$ = this, path, ...args
}) {
return axios($, {
url: `${this._baseUrl()}${path}`,
headers: this._headers(),
...args,
});
Comment thread
michelle0927 marked this conversation as resolved.
},
suggest(args = {}) {
return this._makeRequest({
path: "/v1/suggest",
method: "post",
...args,
});
},
execute(args = {}) {
return this._makeRequest({
path: "/v1/do",
method: "post",
...args,
});
},
listCapabilities(args = {}) {
return this._makeRequest({
path: "/v1/capabilities",
...args,
});
},
getQuality({
slug, ...args
} = {}) {
return this._makeRequest({
path: `/v1/quality/${slug}`,
...args,
});
},
},
};
};
Loading
Loading