@activepieces/piece-griptape 0.1.5 → 0.1.6

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.
Files changed (49) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +13 -50
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-assistant-run.d.ts +0 -11
  7. package/src/lib/actions/create-assistant-run.d.ts.map +0 -1
  8. package/src/lib/actions/create-assistant-run.js +0 -74
  9. package/src/lib/actions/create-assistant-run.js.map +0 -1
  10. package/src/lib/actions/create-structure-run.d.ts +0 -5
  11. package/src/lib/actions/create-structure-run.d.ts.map +0 -1
  12. package/src/lib/actions/create-structure-run.js +0 -47
  13. package/src/lib/actions/create-structure-run.js.map +0 -1
  14. package/src/lib/actions/get-assistant-run.d.ts +0 -5
  15. package/src/lib/actions/get-assistant-run.d.ts.map +0 -1
  16. package/src/lib/actions/get-assistant-run.js +0 -32
  17. package/src/lib/actions/get-assistant-run.js.map +0 -1
  18. package/src/lib/actions/get-structure-run.d.ts +0 -5
  19. package/src/lib/actions/get-structure-run.d.ts.map +0 -1
  20. package/src/lib/actions/get-structure-run.js +0 -32
  21. package/src/lib/actions/get-structure-run.js.map +0 -1
  22. package/src/lib/common/auth.d.ts +0 -2
  23. package/src/lib/common/auth.d.ts.map +0 -1
  24. package/src/lib/common/auth.js +0 -27
  25. package/src/lib/common/auth.js.map +0 -1
  26. package/src/lib/common/client.d.ts +0 -4
  27. package/src/lib/common/client.d.ts.map +0 -1
  28. package/src/lib/common/client.js +0 -27
  29. package/src/lib/common/client.js.map +0 -1
  30. package/src/lib/common/props.d.ts +0 -10
  31. package/src/lib/common/props.d.ts.map +0 -1
  32. package/src/lib/common/props.js +0 -320
  33. package/src/lib/common/props.js.map +0 -1
  34. package/src/lib/triggers/assistant-run-completes.d.ts +0 -11
  35. package/src/lib/triggers/assistant-run-completes.d.ts.map +0 -1
  36. package/src/lib/triggers/assistant-run-completes.js +0 -75
  37. package/src/lib/triggers/assistant-run-completes.js.map +0 -1
  38. package/src/lib/triggers/assistant-run-succeedes.d.ts +0 -11
  39. package/src/lib/triggers/assistant-run-succeedes.d.ts.map +0 -1
  40. package/src/lib/triggers/assistant-run-succeedes.js +0 -75
  41. package/src/lib/triggers/assistant-run-succeedes.js.map +0 -1
  42. package/src/lib/triggers/structure-run-completes.d.ts +0 -11
  43. package/src/lib/triggers/structure-run-completes.d.ts.map +0 -1
  44. package/src/lib/triggers/structure-run-completes.js +0 -68
  45. package/src/lib/triggers/structure-run-completes.js.map +0 -1
  46. package/src/lib/triggers/structure-run-succeeds.d.ts +0 -11
  47. package/src/lib/triggers/structure-run-succeeds.d.ts.map +0 -1
  48. package/src/lib/triggers/structure-run-succeeds.js +0 -68
  49. package/src/lib/triggers/structure-run-succeeds.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-structure-run.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-structure-run.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA8C;AAC9C,2CAAsD;AACtD,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,sDAAsD;IACnE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,mSAAmS;QACrS,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,2BAAmB;QACjC,UAAU,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACzB,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAExD,MAAM,WAAW,GAA4B;gBAC3C,IAAI,EAAE,UAAU;aACjB,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,eAAe,YAAY,OAAO,EAClC,WAAW,CACZ,CAAC;YAEF,MAAM,cAAc,GAAG,QAAQ,CAAC,gBAAgB,CAAC;YAEjD,IAAI,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;YAChC,IAAI,OAAO,GAAG,QAAQ,CAAC;YAEvB,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;gBACjC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;gBAE1D,OAAO,GAAG,MAAM,IAAA,oBAAW,EACzB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,GAAG,EACd,mBAAmB,cAAc,EAAE,CACpC,CAAC;gBAEF,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;YAC7B,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const getAssistantRun: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- assistant_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- assistant_run_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- }>;
5
- //# sourceMappingURL=get-assistant-run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-assistant-run.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-assistant-run.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;EA0B1B,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAssistantRun = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../common/auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- exports.getAssistantRun = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.griptapeAuth,
12
- name: 'getAssistantRun',
13
- displayName: 'Get Assistant Run',
14
- description: 'Get details of a specific assistant run',
15
- audience: 'both',
16
- aiMetadata: {
17
- description: 'Fetches the details and current status/output of a single existing Griptape Cloud assistant run by its run ID. Use to check or retrieve the result of a run started elsewhere; requires a known assistant run ID. Idempotent read-only lookup.',
18
- idempotent: true,
19
- },
20
- props: {
21
- assistant_id: props_1.assistantIdDropdown,
22
- assistant_run_id: props_1.assistantRunsDropdown,
23
- },
24
- run(context) {
25
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
- const { assistant_run_id } = context.propsValue;
27
- const response = yield (0, client_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.GET, `/assistant-runs/${assistant_run_id}`);
28
- return response;
29
- });
30
- },
31
- });
32
- //# sourceMappingURL=get-assistant-run.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-assistant-run.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-assistant-run.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,yCAA8C;AAC9C,6CAA+C;AAC/C,2CAA6E;AAEhE,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,gPAAgP;QAClP,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,2BAAmB;QACjC,gBAAgB,EAAE,6BAAqB;KACxC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEhD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,GAAG,EACd,mBAAmB,gBAAgB,EAAE,CACtC,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const getStructureRun: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- structure_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- structure_run_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- }>;
5
- //# sourceMappingURL=get-structure-run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-structure-run.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-structure-run.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;EA0B1B,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStructureRun = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const props_1 = require("../common/props");
8
- const client_1 = require("../common/client");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- exports.getStructureRun = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.griptapeAuth,
12
- name: 'getStructureRun',
13
- displayName: 'Get Structure Run',
14
- description: 'Get details of a specific structure run',
15
- audience: 'both',
16
- aiMetadata: {
17
- description: 'Fetches the details and current status/output of a single existing Griptape Cloud structure run by its run ID. Use to check or retrieve the result of a structure run started elsewhere; requires a known structure run ID. Idempotent read-only lookup.',
18
- idempotent: true,
19
- },
20
- props: {
21
- structure_id: props_1.structureIdDropdown,
22
- structure_run_id: props_1.structureRunsDropdown,
23
- },
24
- run(context) {
25
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
- const { structure_run_id } = context.propsValue;
27
- const response = yield (0, client_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.GET, `/structure-runs/${structure_run_id}`);
28
- return response;
29
- });
30
- },
31
- });
32
- //# sourceMappingURL=get-structure-run.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-structure-run.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-structure-run.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA8C;AAC9C,2CAA6E;AAC7E,6CAA+C;AAC/C,+DAAyD;AAE5C,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,0PAA0P;QAC5P,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,2BAAmB;QACjC,gBAAgB,EAAE,6BAAqB;KACxC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEhD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,GAAG,EACd,mBAAmB,gBAAgB,EAAE,CACtC,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const griptapeAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,mEAiBvB,CAAC"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.griptapeAuth = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const client_1 = require("./client");
8
- exports.griptapeAuth = pieces_framework_1.PieceAuth.SecretText({
9
- displayName: 'API Key',
10
- description: '',
11
- required: true,
12
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
13
- try {
14
- yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, `/organizations`);
15
- return {
16
- valid: true,
17
- };
18
- }
19
- catch (error) {
20
- return {
21
- valid: false,
22
- error: 'Invalid API key. Please check your Griptape Cloud API key.',
23
- };
24
- }
25
- }),
26
- });
27
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA2D;AAC3D,qCAAuC;AAE1B,QAAA,YAAY,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC/C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,IAAA,oBAAW,EAAC,IAAI,EAAE,0BAAU,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;YAC1D,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,4DAA4D;aACpE,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { HttpMethod } from '@activepieces/pieces-common';
2
- export declare const BASE_URL = "https://cloud.griptape.ai/api";
3
- export declare function makeRequest(api_key: string, method: HttpMethod, path: string, body?: unknown): Promise<any>;
4
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,6BAA6B,CAAC;AAErE,eAAO,MAAM,QAAQ,kCAAkC,CAAC;AAExD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,gBAgBf"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BASE_URL = void 0;
4
- exports.makeRequest = makeRequest;
5
- const tslib_1 = require("tslib");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- exports.BASE_URL = `https://cloud.griptape.ai/api`;
8
- function makeRequest(api_key, method, path, body) {
9
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- try {
11
- const response = yield pieces_common_1.httpClient.sendRequest({
12
- method,
13
- url: `${exports.BASE_URL}${path}`,
14
- headers: {
15
- Authorization: `Bearer ${api_key}`,
16
- 'Content-Type': 'application/json',
17
- },
18
- body,
19
- });
20
- return response.body;
21
- }
22
- catch (error) {
23
- throw new Error(`Unexpected error: ${error.message || String(error)}`);
24
- }
25
- });
26
- }
27
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":";;;AAIA,kCAoBC;;AAxBD,+DAAqE;AAExD,QAAA,QAAQ,GAAG,+BAA+B,CAAC;AAExD,SAAsB,WAAW,CAC/B,OAAe,EACf,MAAkB,EAClB,IAAY,EACZ,IAAc;;QAEd,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM;gBACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,IAAI,EAAE;gBACzB,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,OAAO,EAAE;oBAClC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI;aACL,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CAAA"}
@@ -1,10 +0,0 @@
1
- export declare const assistantIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
2
- export declare const knowledgeBaseIdsDropdown: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- export declare const rulesetIdsDropdown: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- export declare const structuresIdsDropdown: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
5
- export declare const toolsIdsDropdown: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
6
- export declare const threadIdsDropdown: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
7
- export declare const structureIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
8
- export declare const assistantRunsDropdown: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
9
- export declare const structureRunsDropdown: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
10
- //# sourceMappingURL=props.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,6IAmC9B,CAAC;AAEH,eAAO,MAAM,wBAAwB,yJAmCnC,CAAC;AAEH,eAAO,MAAM,kBAAkB,yJAmC7B,CAAC;AAEH,eAAO,MAAM,qBAAqB,yJAmChC,CAAC;AAEH,eAAO,MAAM,gBAAgB,yJAmC3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,yJAoC5B,CAAC;AAEH,eAAO,MAAM,mBAAmB,6IAoC9B,CAAC;AAEH,eAAO,MAAM,qBAAqB,6IA4ChC,CAAC;AAEH,eAAO,MAAM,qBAAqB,6IA4ChC,CAAC"}
@@ -1,320 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.structureRunsDropdown = exports.assistantRunsDropdown = exports.structureIdDropdown = exports.threadIdsDropdown = exports.toolsIdsDropdown = exports.structuresIdsDropdown = exports.rulesetIdsDropdown = exports.knowledgeBaseIdsDropdown = exports.assistantIdDropdown = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const client_1 = require("./client");
7
- const pieces_common_1 = require("@activepieces/pieces-common");
8
- const auth_1 = require("./auth");
9
- exports.assistantIdDropdown = pieces_framework_1.Property.Dropdown({
10
- displayName: 'Assistant',
11
- description: 'Select the assistant',
12
- required: true,
13
- refreshers: [],
14
- auth: auth_1.griptapeAuth,
15
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
16
- if (!auth) {
17
- return {
18
- disabled: true,
19
- options: [],
20
- placeholder: 'Please connect your account first',
21
- };
22
- }
23
- try {
24
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/assistants');
25
- return {
26
- disabled: false,
27
- options: response.assistants.map((assistant) => ({
28
- label: assistant.name,
29
- value: assistant.assistant_id,
30
- })),
31
- };
32
- }
33
- catch (error) {
34
- return {
35
- disabled: true,
36
- options: [],
37
- placeholder: 'Could not fetch assistants',
38
- };
39
- }
40
- }),
41
- });
42
- exports.knowledgeBaseIdsDropdown = pieces_framework_1.Property.MultiSelectDropdown({
43
- displayName: 'Knowledge Bases',
44
- description: 'Select knowledge bases to use',
45
- required: false,
46
- refreshers: [],
47
- auth: auth_1.griptapeAuth,
48
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
49
- if (!auth) {
50
- return {
51
- disabled: true,
52
- options: [],
53
- placeholder: 'Please connect your account first',
54
- };
55
- }
56
- try {
57
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/knowledge-bases');
58
- return {
59
- disabled: false,
60
- options: response.knowledge_bases.map((kb) => ({
61
- label: kb.name,
62
- value: kb.knowledge_base_id,
63
- })),
64
- };
65
- }
66
- catch (error) {
67
- return {
68
- disabled: true,
69
- options: [],
70
- placeholder: 'Could not fetch knowledge bases',
71
- };
72
- }
73
- }),
74
- });
75
- exports.rulesetIdsDropdown = pieces_framework_1.Property.MultiSelectDropdown({
76
- displayName: 'Rulesets',
77
- description: 'Select rulesets to apply',
78
- required: false,
79
- refreshers: [],
80
- auth: auth_1.griptapeAuth,
81
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
82
- if (!auth) {
83
- return {
84
- disabled: true,
85
- options: [],
86
- placeholder: 'Please connect your account first',
87
- };
88
- }
89
- try {
90
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/rulesets');
91
- return {
92
- disabled: false,
93
- options: response.rulesets.map((rs) => ({
94
- label: rs.name,
95
- value: rs.ruleset_id,
96
- })),
97
- };
98
- }
99
- catch (error) {
100
- return {
101
- disabled: true,
102
- options: [],
103
- placeholder: 'Could not fetch rulesets',
104
- };
105
- }
106
- }),
107
- });
108
- exports.structuresIdsDropdown = pieces_framework_1.Property.MultiSelectDropdown({
109
- displayName: 'Structures',
110
- description: 'Select structures to use',
111
- required: false,
112
- refreshers: [],
113
- auth: auth_1.griptapeAuth,
114
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
115
- if (!auth) {
116
- return {
117
- disabled: true,
118
- options: [],
119
- placeholder: 'Please connect your account first',
120
- };
121
- }
122
- try {
123
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/structures');
124
- return {
125
- disabled: false,
126
- options: response.structures.map((structure) => ({
127
- label: structure.name,
128
- value: structure.structure_id,
129
- })),
130
- };
131
- }
132
- catch (error) {
133
- return {
134
- disabled: true,
135
- options: [],
136
- placeholder: 'Could not fetch structures',
137
- };
138
- }
139
- }),
140
- });
141
- exports.toolsIdsDropdown = pieces_framework_1.Property.MultiSelectDropdown({
142
- displayName: 'Tools',
143
- description: 'Select tools to use',
144
- required: false,
145
- refreshers: [],
146
- auth: auth_1.griptapeAuth,
147
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
148
- if (!auth) {
149
- return {
150
- disabled: true,
151
- options: [],
152
- placeholder: 'Please connect your account first',
153
- };
154
- }
155
- try {
156
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/tools');
157
- return {
158
- disabled: false,
159
- options: response.tools.map((tool) => ({
160
- label: tool.name,
161
- value: tool.tool_id,
162
- })),
163
- };
164
- }
165
- catch (error) {
166
- return {
167
- disabled: true,
168
- options: [],
169
- placeholder: 'Could not fetch tools',
170
- };
171
- }
172
- }),
173
- });
174
- exports.threadIdsDropdown = pieces_framework_1.Property.MultiSelectDropdown({
175
- displayName: 'Thread',
176
- description: 'Select the thread',
177
- required: false,
178
- refreshers: [],
179
- auth: auth_1.griptapeAuth,
180
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
181
- if (!auth) {
182
- return {
183
- disabled: true,
184
- options: [],
185
- placeholder: 'Please connect your account first',
186
- };
187
- }
188
- try {
189
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/threads`);
190
- return {
191
- disabled: false,
192
- options: response.threads.map((thread) => ({
193
- label: thread.name,
194
- value: thread.thread_id,
195
- })),
196
- };
197
- }
198
- catch (error) {
199
- return {
200
- disabled: true,
201
- options: [],
202
- placeholder: 'Could not fetch threads',
203
- };
204
- }
205
- }),
206
- });
207
- exports.structureIdDropdown = pieces_framework_1.Property.Dropdown({
208
- displayName: 'Structure',
209
- description: 'Select the structure',
210
- required: true,
211
- refreshers: [],
212
- auth: auth_1.griptapeAuth,
213
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
214
- if (!auth) {
215
- return {
216
- disabled: true,
217
- options: [],
218
- placeholder: 'Please connect your account first',
219
- };
220
- }
221
- try {
222
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/structures`);
223
- return {
224
- disabled: false,
225
- options: response.structures.map((structure) => ({
226
- label: structure.name,
227
- value: structure.structure_id,
228
- })),
229
- };
230
- }
231
- catch (error) {
232
- return {
233
- disabled: true,
234
- options: [],
235
- placeholder: 'Could not fetch structures',
236
- };
237
- }
238
- }),
239
- });
240
- exports.assistantRunsDropdown = pieces_framework_1.Property.Dropdown({
241
- displayName: 'Assistant Run',
242
- description: 'Select the assistant run',
243
- required: true,
244
- refreshers: ['assistant_id'],
245
- auth: auth_1.griptapeAuth,
246
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, assistant_id }) {
247
- if (!auth) {
248
- return {
249
- disabled: true,
250
- options: [],
251
- placeholder: 'Please connect your account first',
252
- };
253
- }
254
- if (!assistant_id) {
255
- return {
256
- disabled: true,
257
- options: [],
258
- placeholder: 'Please select an assistant first',
259
- };
260
- }
261
- try {
262
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/assistants/${assistant_id}/runs`);
263
- return {
264
- disabled: false,
265
- options: response.assistant_runs.map((run) => ({
266
- label: `${run.assistant_run_id} - ${run.status}`,
267
- value: run.assistant_run_id,
268
- })),
269
- };
270
- }
271
- catch (error) {
272
- return {
273
- disabled: true,
274
- options: [],
275
- placeholder: 'Could not fetch assistant runs',
276
- };
277
- }
278
- }),
279
- });
280
- exports.structureRunsDropdown = pieces_framework_1.Property.Dropdown({
281
- displayName: 'Structure Run',
282
- description: 'Select the structure run',
283
- required: true,
284
- refreshers: ['structure_id'],
285
- auth: auth_1.griptapeAuth,
286
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, structure_id }) {
287
- if (!auth) {
288
- return {
289
- disabled: true,
290
- options: [],
291
- placeholder: 'Please connect your account first',
292
- };
293
- }
294
- if (!structure_id) {
295
- return {
296
- disabled: true,
297
- options: [],
298
- placeholder: 'Please select a structure first',
299
- };
300
- }
301
- try {
302
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/structures/${structure_id}/runs`);
303
- return {
304
- disabled: false,
305
- options: response.runs.map((run) => ({
306
- label: `${run.structure_run_id} - ${run.status}`,
307
- value: run.structure_run_id,
308
- })),
309
- };
310
- }
311
- catch (error) {
312
- return {
313
- disabled: true,
314
- options: [],
315
- placeholder: 'Could not fetch structure runs',
316
- };
317
- }
318
- }),
319
- });
320
- //# sourceMappingURL=props.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"props.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AAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC;oBACxC,KAAK,EAAE,GAAG,GAAG,CAAC,gBAAgB,MAAM,GAAG,CAAC,MAAM,EAAE;oBAChD,KAAK,EAAE,GAAG,CAAC,gBAAgB;iBAC5B,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,gCAAgC;aAC9C,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const assistantRunCompletes: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
- assistant_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
5
- assistant_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
6
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
7
- assistant_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
9
- assistant_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
10
- }>;
11
- //# sourceMappingURL=assistant-run-completes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assistant-run-completes.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/assistant-run-completes.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,gCAAgC,CAAC;AA+CxC,eAAO,MAAM,qBAAqB;;;;;;;;EAkChC,CAAC"}
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assistantRunCompletes = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
8
- const auth_1 = require("../common/auth");
9
- const client_1 = require("../common/client");
10
- const props_1 = require("../common/props");
11
- const props = {
12
- assistant_id: props_1.assistantIdDropdown,
13
- };
14
- const polling = {
15
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
16
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ propsValue, auth, lastFetchEpochMS }) {
17
- const { assistant_id } = propsValue;
18
- try {
19
- const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/assistants/${assistant_id}/runs?status=SUCCEEDED,FAILED,ERROR,CANCELLED&page_size=100`);
20
- const items = response.assistant_runs || [];
21
- const completedRuns = items.filter((run) => ['SUCCEEDED', 'FAILED', 'ERROR', 'CANCELLED'].includes(run.status) &&
22
- (0, dayjs_1.default)(run.completed_at || run.updated_at).valueOf() > lastFetchEpochMS);
23
- return completedRuns.map((run) => ({
24
- epochMilliSeconds: (0, dayjs_1.default)(run.completed_at || run.updated_at).valueOf(),
25
- data: run,
26
- }));
27
- }
28
- catch (error) {
29
- console.error('Error fetching assistant runs:', error);
30
- return [];
31
- }
32
- }),
33
- };
34
- exports.assistantRunCompletes = (0, pieces_framework_1.createTrigger)({
35
- auth: auth_1.griptapeAuth,
36
- name: 'assistantRunCompletes',
37
- displayName: 'Assistant Run Completes',
38
- description: 'Trigger when an assistant run is completed (succeeded, failed, or cancelled)',
39
- aiMetadata: {
40
- description: 'Fires when a run for the selected Griptape Cloud assistant reaches any terminal state, including SUCCEEDED, FAILED, ERROR, or CANCELLED. Polls for newly completed runs; use when you need to react to a finished assistant run regardless of whether it succeeded.',
41
- },
42
- props,
43
- sampleData: {
44
- assistant_run_id: 'sample-run-id',
45
- assistant_id: 'sample-assistant-id',
46
- status: 'SUCCEEDED',
47
- output: 'Sample output from assistant run',
48
- created_at: new Date().toISOString(),
49
- completed_at: new Date().toISOString(),
50
- },
51
- type: pieces_framework_1.TriggerStrategy.POLLING,
52
- test(context) {
53
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
54
- return yield pieces_common_1.pollingHelper.test(polling, context);
55
- });
56
- },
57
- onEnable(context) {
58
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
- const { store, auth, propsValue } = context;
60
- yield pieces_common_1.pollingHelper.onEnable(polling, { store, auth, propsValue });
61
- });
62
- },
63
- onDisable(context) {
64
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
65
- const { store, auth, propsValue } = context;
66
- yield pieces_common_1.pollingHelper.onDisable(polling, { store, auth, propsValue });
67
- });
68
- },
69
- run(context) {
70
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
- return yield pieces_common_1.pollingHelper.poll(polling, context);
72
- });
73
- },
74
- });
75
- //# sourceMappingURL=assistant-run-completes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assistant-run-completes.js","sourceRoot":"","sources":["../../../../src/lib/triggers/assistant-run-completes.ts"],"names":[],"mappings":";;;;AAAA,qEAKwC;AACxC,+DAKqC;AACrC,0DAA0B;AAC1B,yCAA8C;AAC9C,6CAA+C;AAC/C,2CAAsD;AAEtD,MAAM,KAAK,GAAG;IACZ,YAAY,EAAE,2BAAmB;CAClC,CAAC;AAEF,MAAM,OAAO,GAAoG;IAC/G,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,UAAU,EAAE,I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