@squadbase/vite-server 0.1.17-dev.24af54e → 0.1.17-dev.423ee34
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/cli/index.js +4873 -1073
- package/dist/connectors/airtable-oauth.js +78 -11
- package/dist/connectors/airtable.js +74 -11
- package/dist/connectors/amplitude.js +38 -11
- package/dist/connectors/anthropic.js +4 -2
- package/dist/connectors/asana.js +67 -13
- package/dist/connectors/attio.js +60 -16
- package/dist/connectors/aws-billing.js +38 -11
- package/dist/connectors/azure-sql.js +64 -13
- package/dist/connectors/backlog-api-key.js +70 -18
- package/dist/connectors/clickup.js +80 -13
- package/dist/connectors/cosmosdb.js +42 -15
- package/dist/connectors/customerio.js +39 -12
- package/dist/connectors/dbt.js +716 -28
- package/dist/connectors/freshdesk.js +112 -11
- package/dist/connectors/freshsales.js +38 -11
- package/dist/connectors/freshservice.js +38 -11
- package/dist/connectors/gamma.js +47 -20
- package/dist/connectors/gemini.js +4 -2
- package/dist/connectors/github.js +42 -15
- package/dist/connectors/gmail-oauth.js +38 -13
- package/dist/connectors/gmail.js +34 -7
- package/dist/connectors/google-ads.js +38 -11
- package/dist/connectors/google-analytics-oauth.js +182 -28
- package/dist/connectors/google-analytics.js +653 -104
- package/dist/connectors/google-audit-log.js +34 -7
- package/dist/connectors/google-calendar-oauth.js +91 -18
- package/dist/connectors/google-calendar.js +91 -14
- package/dist/connectors/google-docs.js +38 -13
- package/dist/connectors/google-drive.js +60 -13
- package/dist/connectors/google-search-console-oauth.js +156 -20
- package/dist/connectors/google-sheets.js +36 -9
- package/dist/connectors/google-slides.js +38 -13
- package/dist/connectors/grafana.js +75 -13
- package/dist/connectors/hubspot-oauth.js +69 -12
- package/dist/connectors/hubspot.js +55 -12
- package/dist/connectors/influxdb.js +38 -11
- package/dist/connectors/intercom-oauth.js +100 -15
- package/dist/connectors/intercom.js +42 -15
- package/dist/connectors/jdbc.js +36 -9
- package/dist/connectors/jira-api-key.js +98 -14
- package/dist/connectors/kintone-api-token.js +96 -21
- package/dist/connectors/kintone.js +84 -14
- package/dist/connectors/linear.js +84 -15
- package/dist/connectors/linkedin-ads.js +71 -17
- package/dist/connectors/mailchimp-oauth.js +36 -9
- package/dist/connectors/mailchimp.js +36 -9
- package/dist/connectors/meta-ads-oauth.js +63 -17
- package/dist/connectors/meta-ads.js +65 -17
- package/dist/connectors/mixpanel.js +38 -11
- package/dist/connectors/monday.js +39 -12
- package/dist/connectors/mongodb.js +38 -11
- package/dist/connectors/notion-oauth.js +88 -14
- package/dist/connectors/notion.js +90 -14
- package/dist/connectors/openai.js +4 -2
- package/dist/connectors/oracle.js +78 -20
- package/dist/connectors/outlook-oauth.js +48 -23
- package/dist/connectors/powerbi-oauth.js +321 -49
- package/dist/connectors/salesforce.js +72 -12
- package/dist/connectors/semrush.js +374 -52
- package/dist/connectors/sentry.js +66 -13
- package/dist/connectors/shopify-oauth.js +71 -13
- package/dist/connectors/shopify.js +38 -11
- package/dist/connectors/sqlserver.js +64 -13
- package/dist/connectors/stripe-api-key.js +96 -18
- package/dist/connectors/stripe-oauth.js +98 -22
- package/dist/connectors/supabase.js +55 -11
- package/dist/connectors/tableau.js +262 -92
- package/dist/connectors/tiktok-ads.js +67 -19
- package/dist/connectors/wix-store.js +38 -11
- package/dist/connectors/zendesk-oauth.js +83 -15
- package/dist/connectors/zendesk.js +42 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4902 -1077
- package/dist/main.js +4891 -1071
- package/dist/vite-plugin.js +4871 -1071
- package/package.json +1 -1
package/dist/connectors/asana.js
CHANGED
|
@@ -16,6 +16,7 @@ var init_parameter_definition = __esm({
|
|
|
16
16
|
type;
|
|
17
17
|
secret;
|
|
18
18
|
required;
|
|
19
|
+
isDeprecated;
|
|
19
20
|
constructor(config) {
|
|
20
21
|
this.slug = config.slug;
|
|
21
22
|
this.name = config.name;
|
|
@@ -24,6 +25,7 @@ var init_parameter_definition = __esm({
|
|
|
24
25
|
this.type = config.type;
|
|
25
26
|
this.secret = config.secret;
|
|
26
27
|
this.required = config.required;
|
|
28
|
+
this.isDeprecated = config.isDeprecated ?? false;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Get the parameter value from a ConnectorConnectionObject.
|
|
@@ -312,7 +314,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
312
314
|
/**
|
|
313
315
|
* Create tools for connections that belong to this connector.
|
|
314
316
|
* Filters connections by connectorKey internally.
|
|
315
|
-
* Returns tools keyed as
|
|
317
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
316
318
|
*/
|
|
317
319
|
createTools(connections, config, opts) {
|
|
318
320
|
const myConnections = connections.filter(
|
|
@@ -322,7 +324,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
322
324
|
for (const t of Object.values(this.tools)) {
|
|
323
325
|
const tool = t.createTool(myConnections, config);
|
|
324
326
|
const originalToModelOutput = tool.toModelOutput;
|
|
325
|
-
result[
|
|
327
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
326
328
|
...tool,
|
|
327
329
|
toModelOutput: async (options) => {
|
|
328
330
|
if (!originalToModelOutput) {
|
|
@@ -378,19 +380,34 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
378
380
|
};
|
|
379
381
|
let state = flow.initialState();
|
|
380
382
|
let answerIdx = 0;
|
|
383
|
+
const pendingParameterUpdates = [];
|
|
381
384
|
for (const step of flow.steps) {
|
|
382
385
|
const ans = ctx.answers[answerIdx];
|
|
383
386
|
if (ans && ans.questionSlug === step.slug) {
|
|
384
387
|
state = step.applyAnswer(state, ans.answer);
|
|
388
|
+
if (step.toParameterUpdates) {
|
|
389
|
+
pendingParameterUpdates.push(...step.toParameterUpdates(state));
|
|
390
|
+
}
|
|
385
391
|
answerIdx += 1;
|
|
386
392
|
continue;
|
|
387
393
|
}
|
|
394
|
+
const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
|
|
388
395
|
if (step.type === "text") {
|
|
396
|
+
if (step.fetchOptions) {
|
|
397
|
+
const options2 = await step.fetchOptions(state, runtime);
|
|
398
|
+
if (options2.length === 0) {
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
389
402
|
return {
|
|
390
403
|
type: "nextQuestion",
|
|
391
404
|
questionSlug: step.slug,
|
|
392
405
|
question: step.question[ctx.language],
|
|
393
|
-
questionType: "text"
|
|
406
|
+
questionType: "text",
|
|
407
|
+
allowFreeText: resolvedAllowFreeText,
|
|
408
|
+
...pendingParameterUpdates.length > 0 && {
|
|
409
|
+
parameterUpdates: pendingParameterUpdates
|
|
410
|
+
}
|
|
394
411
|
};
|
|
395
412
|
}
|
|
396
413
|
const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
|
|
@@ -402,11 +419,21 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
402
419
|
questionSlug: step.slug,
|
|
403
420
|
question: step.question[ctx.language],
|
|
404
421
|
questionType: step.type,
|
|
405
|
-
options
|
|
422
|
+
options,
|
|
423
|
+
allowFreeText: resolvedAllowFreeText,
|
|
424
|
+
...pendingParameterUpdates.length > 0 && {
|
|
425
|
+
parameterUpdates: pendingParameterUpdates
|
|
426
|
+
}
|
|
406
427
|
};
|
|
407
428
|
}
|
|
408
429
|
const dataInvestigationResult = await flow.finalize(state, runtime);
|
|
409
|
-
return {
|
|
430
|
+
return {
|
|
431
|
+
type: "fulfilled",
|
|
432
|
+
dataInvestigationResult,
|
|
433
|
+
...pendingParameterUpdates.length > 0 && {
|
|
434
|
+
parameterUpdates: pendingParameterUpdates
|
|
435
|
+
}
|
|
436
|
+
};
|
|
410
437
|
}
|
|
411
438
|
async function resolveSetupSelection(params) {
|
|
412
439
|
const { selected, allSentinel, fetchAll, limit } = params;
|
|
@@ -437,13 +464,13 @@ function normalizeRequestPath(path2, basePathSegment) {
|
|
|
437
464
|
// ../connectors/src/connectors/asana/setup.ts
|
|
438
465
|
var asanaOnboarding = new ConnectorOnboarding({
|
|
439
466
|
dataOverviewInstructions: {
|
|
440
|
-
en: `1. Call
|
|
441
|
-
2. Pick the first workspace and call
|
|
442
|
-
3. Pick one project and call
|
|
467
|
+
en: `1. Call connector_asana_request with GET /workspaces to list all available workspaces
|
|
468
|
+
2. Pick the first workspace and call connector_asana_request with GET /projects?workspace=WORKSPACE_GID&opt_fields=name,archived,created_at to list projects
|
|
469
|
+
3. Pick one project and call connector_asana_request with GET /tasks?project=PROJECT_GID&opt_fields=name,completed,assignee.name,due_on,created_at&limit=10 to sample tasks
|
|
443
470
|
4. Explore sections via GET /sections?project=PROJECT_GID if the project uses board or section-based workflows`,
|
|
444
|
-
ja: `1.
|
|
445
|
-
2. \u6700\u521D\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3092\u9078\u3073\
|
|
446
|
-
3. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30921\u3064\u9078\u3073\
|
|
471
|
+
ja: `1. connector_asana_request \u3067 GET /workspaces \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
472
|
+
2. \u6700\u521D\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3092\u9078\u3073\u3001connector_asana_request \u3067 GET /projects?workspace=WORKSPACE_GID&opt_fields=name,archived,created_at \u3092\u547C\u3073\u51FA\u3057\u3066\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
|
|
473
|
+
3. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30921\u3064\u9078\u3073\u3001connector_asana_request \u3067 GET /tasks?project=PROJECT_GID&opt_fields=name,completed,assignee.name,due_on,created_at&limit=10 \u3092\u547C\u3073\u51FA\u3057\u3066\u30BF\u30B9\u30AF\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
|
|
447
474
|
4. \u30DC\u30FC\u30C9\u3084\u30BB\u30AF\u30B7\u30E7\u30F3\u30D9\u30FC\u30B9\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E\u5834\u5408\u306F GET /sections?project=PROJECT_GID \u3067\u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u78BA\u8A8D`
|
|
448
475
|
}
|
|
449
476
|
});
|
|
@@ -474,6 +501,26 @@ async function listWorkspaces(params) {
|
|
|
474
501
|
const data = await res.json();
|
|
475
502
|
return data.data ?? [];
|
|
476
503
|
}
|
|
504
|
+
async function getTaskBreakdown(params, projectGid) {
|
|
505
|
+
try {
|
|
506
|
+
const res = await apiFetch(
|
|
507
|
+
params,
|
|
508
|
+
`/projects/${encodeURIComponent(projectGid)}/tasks?limit=100&opt_fields=completed`
|
|
509
|
+
);
|
|
510
|
+
if (!res.ok) return null;
|
|
511
|
+
const data = await res.json();
|
|
512
|
+
const tasks = data.data ?? [];
|
|
513
|
+
const completed = tasks.filter((t) => t.completed).length;
|
|
514
|
+
const hasMore = !!data.next_page?.offset;
|
|
515
|
+
return {
|
|
516
|
+
total: tasks.length + (hasMore ? 100 : 0),
|
|
517
|
+
completed,
|
|
518
|
+
incomplete: tasks.length - completed
|
|
519
|
+
};
|
|
520
|
+
} catch {
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
477
524
|
async function listProjects(params, workspaceGid) {
|
|
478
525
|
const all = [];
|
|
479
526
|
const fields = encodeURIComponent("name,team.name,current_status");
|
|
@@ -562,6 +609,13 @@ var asanaSetupFlow = {
|
|
|
562
609
|
const status = project.current_status?.title ?? project.current_status?.text ?? "-";
|
|
563
610
|
sections.push(`- Team: ${team}`);
|
|
564
611
|
sections.push(`- Current status: ${status}`);
|
|
612
|
+
const tasks = await getTaskBreakdown(rt.params, gid);
|
|
613
|
+
if (tasks) {
|
|
614
|
+
const suffix = tasks.total >= 100 ? "+" : "";
|
|
615
|
+
sections.push(
|
|
616
|
+
`- Tasks: ${tasks.total}${suffix} (${tasks.completed} completed, ${tasks.incomplete} incomplete)`
|
|
617
|
+
);
|
|
618
|
+
}
|
|
565
619
|
sections.push("");
|
|
566
620
|
}
|
|
567
621
|
return sections.join("\n");
|
|
@@ -683,7 +737,7 @@ var asanaConnector = new ConnectorPlugin({
|
|
|
683
737
|
systemPrompt: {
|
|
684
738
|
en: `### Tools
|
|
685
739
|
|
|
686
|
-
- \`
|
|
740
|
+
- \`connector_asana_request\`: The only way to call the Asana REST API. Use it to list workspaces, projects, tasks, users, sections, tags, and more. Authentication (Bearer token with Personal Access Token) is configured automatically. Provide the API path and optionally append query parameters like opt_fields for field selection.
|
|
687
741
|
|
|
688
742
|
### Business Logic
|
|
689
743
|
|
|
@@ -770,7 +824,7 @@ export default async function handler(c: Context) {
|
|
|
770
824
|
- Users: name, email, photo`,
|
|
771
825
|
ja: `### \u30C4\u30FC\u30EB
|
|
772
826
|
|
|
773
|
-
- \`
|
|
827
|
+
- \`connector_asana_request\`: Asana REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3001\u30BF\u30B9\u30AF\u3001\u30E6\u30FC\u30B6\u30FC\u3001\u30BB\u30AF\u30B7\u30E7\u30F3\u3001\u30BF\u30B0\u306A\u3069\u306E\u4E00\u89A7\u53D6\u5F97\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Personal Access Token\u3092\u4F7F\u7528\u3057\u305FBearer\u30C8\u30FC\u30AF\u30F3\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002API\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066opt_fields\u306A\u3069\u306E\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4ED8\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
774
828
|
|
|
775
829
|
### Business Logic
|
|
776
830
|
|
package/dist/connectors/attio.js
CHANGED
|
@@ -16,6 +16,7 @@ var init_parameter_definition = __esm({
|
|
|
16
16
|
type;
|
|
17
17
|
secret;
|
|
18
18
|
required;
|
|
19
|
+
isDeprecated;
|
|
19
20
|
constructor(config) {
|
|
20
21
|
this.slug = config.slug;
|
|
21
22
|
this.name = config.name;
|
|
@@ -24,6 +25,7 @@ var init_parameter_definition = __esm({
|
|
|
24
25
|
this.type = config.type;
|
|
25
26
|
this.secret = config.secret;
|
|
26
27
|
this.required = config.required;
|
|
28
|
+
this.isDeprecated = config.isDeprecated ?? false;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Get the parameter value from a ConnectorConnectionObject.
|
|
@@ -448,7 +450,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
448
450
|
/**
|
|
449
451
|
* Create tools for connections that belong to this connector.
|
|
450
452
|
* Filters connections by connectorKey internally.
|
|
451
|
-
* Returns tools keyed as
|
|
453
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
452
454
|
*/
|
|
453
455
|
createTools(connections, config, opts) {
|
|
454
456
|
const myConnections = connections.filter(
|
|
@@ -458,7 +460,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
458
460
|
for (const t of Object.values(this.tools)) {
|
|
459
461
|
const tool = t.createTool(myConnections, config);
|
|
460
462
|
const originalToModelOutput = tool.toModelOutput;
|
|
461
|
-
result[
|
|
463
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
462
464
|
...tool,
|
|
463
465
|
toModelOutput: async (options) => {
|
|
464
466
|
if (!originalToModelOutput) {
|
|
@@ -514,19 +516,34 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
514
516
|
};
|
|
515
517
|
let state = flow.initialState();
|
|
516
518
|
let answerIdx = 0;
|
|
519
|
+
const pendingParameterUpdates = [];
|
|
517
520
|
for (const step of flow.steps) {
|
|
518
521
|
const ans = ctx.answers[answerIdx];
|
|
519
522
|
if (ans && ans.questionSlug === step.slug) {
|
|
520
523
|
state = step.applyAnswer(state, ans.answer);
|
|
524
|
+
if (step.toParameterUpdates) {
|
|
525
|
+
pendingParameterUpdates.push(...step.toParameterUpdates(state));
|
|
526
|
+
}
|
|
521
527
|
answerIdx += 1;
|
|
522
528
|
continue;
|
|
523
529
|
}
|
|
530
|
+
const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
|
|
524
531
|
if (step.type === "text") {
|
|
532
|
+
if (step.fetchOptions) {
|
|
533
|
+
const options2 = await step.fetchOptions(state, runtime);
|
|
534
|
+
if (options2.length === 0) {
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
525
538
|
return {
|
|
526
539
|
type: "nextQuestion",
|
|
527
540
|
questionSlug: step.slug,
|
|
528
541
|
question: step.question[ctx.language],
|
|
529
|
-
questionType: "text"
|
|
542
|
+
questionType: "text",
|
|
543
|
+
allowFreeText: resolvedAllowFreeText,
|
|
544
|
+
...pendingParameterUpdates.length > 0 && {
|
|
545
|
+
parameterUpdates: pendingParameterUpdates
|
|
546
|
+
}
|
|
530
547
|
};
|
|
531
548
|
}
|
|
532
549
|
const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
|
|
@@ -538,11 +555,21 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
538
555
|
questionSlug: step.slug,
|
|
539
556
|
question: step.question[ctx.language],
|
|
540
557
|
questionType: step.type,
|
|
541
|
-
options
|
|
558
|
+
options,
|
|
559
|
+
allowFreeText: resolvedAllowFreeText,
|
|
560
|
+
...pendingParameterUpdates.length > 0 && {
|
|
561
|
+
parameterUpdates: pendingParameterUpdates
|
|
562
|
+
}
|
|
542
563
|
};
|
|
543
564
|
}
|
|
544
565
|
const dataInvestigationResult = await flow.finalize(state, runtime);
|
|
545
|
-
return {
|
|
566
|
+
return {
|
|
567
|
+
type: "fulfilled",
|
|
568
|
+
dataInvestigationResult,
|
|
569
|
+
...pendingParameterUpdates.length > 0 && {
|
|
570
|
+
parameterUpdates: pendingParameterUpdates
|
|
571
|
+
}
|
|
572
|
+
};
|
|
546
573
|
}
|
|
547
574
|
async function resolveSetupSelection(params) {
|
|
548
575
|
const { selected, allSentinel, fetchAll, limit } = params;
|
|
@@ -563,16 +590,16 @@ var AUTH_TYPES = {
|
|
|
563
590
|
// ../connectors/src/connectors/attio/setup.ts
|
|
564
591
|
var attioOnboarding = new ConnectorOnboarding({
|
|
565
592
|
dataOverviewInstructions: {
|
|
566
|
-
en: `1. Call
|
|
567
|
-
2. For each object you plan to use, call
|
|
568
|
-
3. Call
|
|
569
|
-
4. Call
|
|
593
|
+
en: `1. Call connector_attio_request with GET /objects to discover the object slugs actually configured in this workspace (typically people, companies, deals, plus any custom objects).
|
|
594
|
+
2. For each object you plan to use, call connector_attio_request with GET /objects/{slug}/attributes to explore its attributes
|
|
595
|
+
3. Call connector_attio_request with POST /objects/{slug}/records/query with { "limit": 5 } to sample records
|
|
596
|
+
4. Call connector_attio_request with GET /workspace_members (top-level, snake_case) to list team members. The response shape is \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\`. You need this mapping in dashboard handlers to resolve \`owner\` and other actor-reference fields (which return \`referenced_actor_id\`, not a name). Sample one record that has an \`owner\` and confirm the shape \`{ referenced_actor_type, referenced_actor_id }\`, then use \`client.getWorkspaceMemberMap()\` in handlers to resolve IDs to names.
|
|
570
597
|
5. If an endpoint later returns 403 (tasks / threads / webhooks / meetings require specific scopes), call GET /self to inspect the token's active scopes.
|
|
571
598
|
6. Explore lists via GET /lists as needed, and use /notes, /tasks, /threads, /comments, /webhooks, /meetings when the question requires them.`,
|
|
572
|
-
ja: `1.
|
|
573
|
-
2. \u4F7F\u3046\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3054\u3068\u306B
|
|
574
|
-
3.
|
|
575
|
-
4.
|
|
599
|
+
ja: `1. connector_attio_request \u3067 GET /objects \u3092\u547C\u3073\u51FA\u3057\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u901A\u5E38\u306F people / companies / deals\u3001\u52A0\u3048\u3066\u8A2D\u5B9A\u6E08\u307F\u306E\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09
|
|
600
|
+
2. \u4F7F\u3046\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3054\u3068\u306B connector_attio_request \u3067 GET /objects/{slug}/attributes \u3092\u547C\u3073\u51FA\u3057\u3001\u5C5E\u6027\u3092\u78BA\u8A8D
|
|
601
|
+
3. connector_attio_request \u3067 POST /objects/{slug}/records/query \u3092 { "limit": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
|
|
602
|
+
4. connector_attio_request \u3067 GET /workspace_members\uFF08\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u3001\u30B9\u30CD\u30FC\u30AF\u30B1\u30FC\u30B9\uFF09\u3092\u547C\u3073\u51FA\u3057\u3001\u30C1\u30FC\u30E0\u30E1\u30F3\u30D0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97\u3002\u30EC\u30B9\u30DD\u30F3\u30B9\u306F \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\` \u306E\u5F62\u5F0F\u3067\u3059\u3002\u3053\u306E\u30DE\u30C3\u30D4\u30F3\u30B0\u306F\u3001\`owner\` \u306A\u3069\u306E actor-reference \u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\`referenced_actor_id\` \u3092\u8FD4\u3059\uFF09\u3092\u540D\u524D\u306B\u89E3\u6C7A\u3059\u308B\u305F\u3081\u306B\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30CF\u30F3\u30C9\u30E9\u3067\u5FC5\u9808\u3067\u3059\u3002\`owner\` \u3092\u6301\u3064\u30EC\u30B3\u30FC\u30C9\u30921\u4EF6\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u3001\`{ referenced_actor_type, referenced_actor_id }\` \u306E\u5F62\u3092\u78BA\u8A8D\u3057\u305F\u4E0A\u3067\u3001\u30CF\u30F3\u30C9\u30E9\u3067\u306F \`client.getWorkspaceMemberMap()\` \u3092\u4F7F\u3063\u3066 ID \u2192 \u540D\u524D \u306B\u89E3\u6C7A\u3057\u3066\u304F\u3060\u3055\u3044
|
|
576
603
|
5. \u5F8C\u6BB5\u3067 403 \u304C\u51FA\u305F\u5834\u5408\uFF08tasks / threads / webhooks / meetings \u306A\u3069\u306F\u500B\u5225\u306E scope \u304C\u5FC5\u8981\uFF09\u306F\u3001GET /self \u3092\u547C\u3073\u51FA\u3057\u3066API\u30C8\u30FC\u30AF\u30F3\u306E\u6709\u52B9 scope \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044
|
|
577
604
|
6. \u5FC5\u8981\u306B\u5FDC\u3058\u3066 GET /lists \u3067\u30EA\u30B9\u30C8\u3092\u63A2\u7D22\u3057\u3001/notes\u3001/tasks\u3001/threads\u3001/comments\u3001/webhooks\u3001/meetings \u3082\u6D3B\u7528\u3057\u3066\u304F\u3060\u3055\u3044`
|
|
578
605
|
}
|
|
@@ -615,6 +642,21 @@ async function listAttributes(params, slug) {
|
|
|
615
642
|
const data = await res.json();
|
|
616
643
|
return data.data ?? [];
|
|
617
644
|
}
|
|
645
|
+
async function probeRecordCount(params, slug) {
|
|
646
|
+
try {
|
|
647
|
+
const res = await apiFetch(params, `/objects/${slug}/records/query`, {
|
|
648
|
+
method: "POST",
|
|
649
|
+
headers: { "Content-Type": "application/json" },
|
|
650
|
+
body: JSON.stringify({ limit: 1 })
|
|
651
|
+
});
|
|
652
|
+
if (!res.ok) return null;
|
|
653
|
+
const data = await res.json();
|
|
654
|
+
const found = (data.data ?? []).length;
|
|
655
|
+
return found > 0 ? "1+" : "0";
|
|
656
|
+
} catch {
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
618
660
|
var attioSetupFlow = {
|
|
619
661
|
initialState: () => ({}),
|
|
620
662
|
steps: [
|
|
@@ -650,7 +692,9 @@ var attioSetupFlow = {
|
|
|
650
692
|
});
|
|
651
693
|
const sections = ["## Attio", ""];
|
|
652
694
|
for (const slug of targetObjects) {
|
|
653
|
-
|
|
695
|
+
const recordIndicator = await probeRecordCount(rt.params, slug);
|
|
696
|
+
const heading = recordIndicator ? `### Object: ${slug} (records: ${recordIndicator})` : `### Object: ${slug}`;
|
|
697
|
+
sections.push(heading, "");
|
|
654
698
|
const attrs = await listAttributes(rt.params, slug);
|
|
655
699
|
const limited = attrs.slice(0, ATTIO_SETUP_MAX_ATTRIBUTES);
|
|
656
700
|
sections.push("| Attribute | Type | Title |");
|
|
@@ -766,7 +810,7 @@ var attioConnector = new ConnectorPlugin({
|
|
|
766
810
|
systemPrompt: {
|
|
767
811
|
en: `### Tools
|
|
768
812
|
|
|
769
|
-
- \`
|
|
813
|
+
- \`connector_attio_request\`: The only way to call the Attio REST API. Use it for every Attio resource \u2014 records (people, companies, deals, and any custom objects configured in the workspace), their attributes, lists and entries, workspace members, notes, tasks, threads, comments, webhooks, and meetings. Authentication (Bearer token) is configured automatically. Querying records uses POST \`/objects/{object}/records/query\` with a JSON body. Use PATCH for partial updates (append multiselect) and PUT for full updates (overwrite multiselect). Always call GET \`/objects\` first to discover the actual object slugs in this workspace.
|
|
770
814
|
|
|
771
815
|
### Business Logic
|
|
772
816
|
|
|
@@ -913,7 +957,7 @@ export default async function handler(c: Context) {
|
|
|
913
957
|
- \`offset\` \u2014 pagination offset`,
|
|
914
958
|
ja: `### \u30C4\u30FC\u30EB
|
|
915
959
|
|
|
916
|
-
- \`
|
|
960
|
+
- \`connector_attio_request\`: Attio REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EC\u30B3\u30FC\u30C9\uFF08people\u3001companies\u3001deals\u3001\u304A\u3088\u3073\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u8A2D\u5B9A\u3055\u308C\u305F\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09\u3068\u305D\u306E\u5C5E\u6027\u3001\u30EA\u30B9\u30C8\u3068\u30A8\u30F3\u30C8\u30EA\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30E1\u30F3\u30D0\u30FC\u3001\u30CE\u30FC\u30C8\u3001\u30BF\u30B9\u30AF\u3001\u30B9\u30EC\u30C3\u30C9\u3001\u30B3\u30E1\u30F3\u30C8\u3001Webhook\u3001\u30DF\u30FC\u30C6\u30A3\u30F3\u30B0\u306A\u3069\u3001\u3059\u3079\u3066\u306EAttio\u30EA\u30BD\u30FC\u30B9\u306E\u64CD\u4F5C\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Bearer\u30C8\u30FC\u30AF\u30F3\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30EC\u30B3\u30FC\u30C9\u306E\u30AF\u30A8\u30EA\u306B\u306F POST \`/objects/{object}/records/query\` \u3092\u30D5\u30A3\u30EB\u30BF\u4ED8\u304D\u306EJSON\u30DC\u30C7\u30A3\u3067\u4F7F\u7528\u3057\u307E\u3059\u3002\u90E8\u5206\u66F4\u65B0\uFF08multiselect\u306E\u8FFD\u52A0\uFF09\u306B\u306FPATCH\u3001\u5168\u7F6E\u63DB\uFF08multiselect\u306E\u4E0A\u66F8\u304D\uFF09\u306B\u306FPUT\u3092\u4F7F\u3044\u307E\u3059\u3002**\u5FC5\u305A** \u6700\u521D\u306B GET \`/objects\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
917
961
|
|
|
918
962
|
### Business Logic
|
|
919
963
|
|
|
@@ -16,6 +16,7 @@ var init_parameter_definition = __esm({
|
|
|
16
16
|
type;
|
|
17
17
|
secret;
|
|
18
18
|
required;
|
|
19
|
+
isDeprecated;
|
|
19
20
|
constructor(config) {
|
|
20
21
|
this.slug = config.slug;
|
|
21
22
|
this.name = config.name;
|
|
@@ -24,6 +25,7 @@ var init_parameter_definition = __esm({
|
|
|
24
25
|
this.type = config.type;
|
|
25
26
|
this.secret = config.secret;
|
|
26
27
|
this.required = config.required;
|
|
28
|
+
this.isDeprecated = config.isDeprecated ?? false;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Get the parameter value from a ConnectorConnectionObject.
|
|
@@ -214,7 +216,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
214
216
|
/**
|
|
215
217
|
* Create tools for connections that belong to this connector.
|
|
216
218
|
* Filters connections by connectorKey internally.
|
|
217
|
-
* Returns tools keyed as
|
|
219
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
218
220
|
*/
|
|
219
221
|
createTools(connections, config, opts) {
|
|
220
222
|
const myConnections = connections.filter(
|
|
@@ -224,7 +226,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
224
226
|
for (const t of Object.values(this.tools)) {
|
|
225
227
|
const tool = t.createTool(myConnections, config);
|
|
226
228
|
const originalToModelOutput = tool.toModelOutput;
|
|
227
|
-
result[
|
|
229
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
228
230
|
...tool,
|
|
229
231
|
toModelOutput: async (options) => {
|
|
230
232
|
if (!originalToModelOutput) {
|
|
@@ -280,19 +282,34 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
280
282
|
};
|
|
281
283
|
let state = flow.initialState();
|
|
282
284
|
let answerIdx = 0;
|
|
285
|
+
const pendingParameterUpdates = [];
|
|
283
286
|
for (const step of flow.steps) {
|
|
284
287
|
const ans = ctx.answers[answerIdx];
|
|
285
288
|
if (ans && ans.questionSlug === step.slug) {
|
|
286
289
|
state = step.applyAnswer(state, ans.answer);
|
|
290
|
+
if (step.toParameterUpdates) {
|
|
291
|
+
pendingParameterUpdates.push(...step.toParameterUpdates(state));
|
|
292
|
+
}
|
|
287
293
|
answerIdx += 1;
|
|
288
294
|
continue;
|
|
289
295
|
}
|
|
296
|
+
const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
|
|
290
297
|
if (step.type === "text") {
|
|
298
|
+
if (step.fetchOptions) {
|
|
299
|
+
const options2 = await step.fetchOptions(state, runtime);
|
|
300
|
+
if (options2.length === 0) {
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
291
304
|
return {
|
|
292
305
|
type: "nextQuestion",
|
|
293
306
|
questionSlug: step.slug,
|
|
294
307
|
question: step.question[ctx.language],
|
|
295
|
-
questionType: "text"
|
|
308
|
+
questionType: "text",
|
|
309
|
+
allowFreeText: resolvedAllowFreeText,
|
|
310
|
+
...pendingParameterUpdates.length > 0 && {
|
|
311
|
+
parameterUpdates: pendingParameterUpdates
|
|
312
|
+
}
|
|
296
313
|
};
|
|
297
314
|
}
|
|
298
315
|
const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
|
|
@@ -304,11 +321,21 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
304
321
|
questionSlug: step.slug,
|
|
305
322
|
question: step.question[ctx.language],
|
|
306
323
|
questionType: step.type,
|
|
307
|
-
options
|
|
324
|
+
options,
|
|
325
|
+
allowFreeText: resolvedAllowFreeText,
|
|
326
|
+
...pendingParameterUpdates.length > 0 && {
|
|
327
|
+
parameterUpdates: pendingParameterUpdates
|
|
328
|
+
}
|
|
308
329
|
};
|
|
309
330
|
}
|
|
310
331
|
const dataInvestigationResult = await flow.finalize(state, runtime);
|
|
311
|
-
return {
|
|
332
|
+
return {
|
|
333
|
+
type: "fulfilled",
|
|
334
|
+
dataInvestigationResult,
|
|
335
|
+
...pendingParameterUpdates.length > 0 && {
|
|
336
|
+
parameterUpdates: pendingParameterUpdates
|
|
337
|
+
}
|
|
338
|
+
};
|
|
312
339
|
}
|
|
313
340
|
async function resolveSetupSelection(params) {
|
|
314
341
|
const { selected, allSentinel, fetchAll, limit } = params;
|
|
@@ -853,9 +880,9 @@ var awsBillingConnector = new ConnectorPlugin({
|
|
|
853
880
|
systemPrompt: {
|
|
854
881
|
en: `### Tools
|
|
855
882
|
|
|
856
|
-
- \`
|
|
857
|
-
- \`
|
|
858
|
-
- \`
|
|
883
|
+
- \`connector_aws-billing-service-account_getCostAndUsage\`: Primary tool for querying historical AWS cost and usage. Use it for spend breakdowns by service/account/region/usage-type, month-over-month comparisons, and identifying cost drivers. Pass a TimePeriod (YYYY-MM-DD), Granularity (DAILY/MONTHLY/HOURLY), Metrics, and optionally GroupBy / Filter. See the Cost Explorer Reference below for valid keys.
|
|
884
|
+
- \`connector_aws-billing-service-account_getDimensionValues\`: Enumerate the valid values for a single Cost Explorer dimension (e.g., list all SERVICE names, LINKED_ACCOUNT IDs, REGIONS). Use this before constructing a Filter so the Filter Expression contains valid values.
|
|
885
|
+
- \`connector_aws-billing-service-account_getCostForecast\`: Forecast future cost or usage. Use this for "what will spend look like next month" questions. The TimePeriod must be in the future.
|
|
859
886
|
|
|
860
887
|
### Cost Explorer Reference
|
|
861
888
|
|
|
@@ -938,9 +965,9 @@ export default async function handler(c: Context) {
|
|
|
938
965
|
\`\`\``,
|
|
939
966
|
ja: `### \u30C4\u30FC\u30EB
|
|
940
967
|
|
|
941
|
-
- \`
|
|
942
|
-
- \`
|
|
943
|
-
- \`
|
|
968
|
+
- \`connector_aws-billing-service-account_getCostAndUsage\`: AWS\u306E\u904E\u53BB\u306E\u30B3\u30B9\u30C8\u30FB\u4F7F\u7528\u91CF\u3092\u53D6\u5F97\u3059\u308B\u30E1\u30A4\u30F3\u30C4\u30FC\u30EB\u3002\u30B5\u30FC\u30D3\u30B9\u5225\u30FB\u30A2\u30AB\u30A6\u30F3\u30C8\u5225\u30FB\u30EA\u30FC\u30B8\u30E7\u30F3\u5225\u30FB\u5229\u7528\u30BF\u30A4\u30D7\u5225\u306E\u652F\u51FA\u5185\u8A33\u3001\u524D\u6708\u6BD4\u8F03\u3001\u4E3B\u8981\u30B3\u30B9\u30C8\u8981\u56E0\u306E\u7279\u5B9A\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002TimePeriod (YYYY-MM-DD)\u3001Granularity (DAILY/MONTHLY/HOURLY)\u3001Metrics\u3001\u30AA\u30D7\u30B7\u30E7\u30F3\u3067 GroupBy / Filter \u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\u6709\u52B9\u306A\u30AD\u30FC\u306F\u4E0B\u8A18\u300CCost Explorer \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3002
|
|
969
|
+
- \`connector_aws-billing-service-account_getDimensionValues\`: \u5358\u4E00\u306ECost Explorer\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u306B\u3064\u3044\u3066\u6709\u52B9\u306A\u5024\u3092\u5217\u6319\u3057\u307E\u3059\uFF08\u4F8B: \u5168 SERVICE \u540D\u3001LINKED_ACCOUNT ID\u3001REGION \u306E\u53D6\u5F97\uFF09\u3002Filter \u3092\u69CB\u7BC9\u3059\u308B\u524D\u306B\u3053\u306E\u30C4\u30FC\u30EB\u3067\u6709\u52B9\u5024\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
970
|
+
- \`connector_aws-billing-service-account_getCostForecast\`: \u5C06\u6765\u306E\u30B3\u30B9\u30C8\u30FB\u4F7F\u7528\u91CF\u3092\u4E88\u6E2C\u3057\u307E\u3059\u3002\u300C\u6765\u6708\u306E\u652F\u51FA\u898B\u8FBC\u307F\u306F\uFF1F\u300D\u306E\u3088\u3046\u306A\u8CEA\u554F\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002TimePeriod \u306F\u672A\u6765\u306E\u65E5\u4ED8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
|
944
971
|
|
|
945
972
|
### Cost Explorer \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
946
973
|
|