@superblocksteam/sdk-api 2.0.104 → 2.0.105-next.1
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/README.md +202 -86
- package/dist/api/definition.d.ts +11 -6
- package/dist/api/definition.d.ts.map +1 -1
- package/dist/api/definition.js +19 -12
- package/dist/api/definition.js.map +1 -1
- package/dist/api/definition.test.js +39 -15
- package/dist/api/definition.test.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/integrations/base/index.d.ts +2 -1
- package/dist/integrations/base/index.d.ts.map +1 -1
- package/dist/integrations/base/index.js +1 -0
- package/dist/integrations/base/index.js.map +1 -1
- package/dist/integrations/base/rest-api-client-base.d.ts +48 -0
- package/dist/integrations/base/rest-api-client-base.d.ts.map +1 -0
- package/dist/integrations/base/rest-api-client-base.js +98 -0
- package/dist/integrations/base/rest-api-client-base.js.map +1 -0
- package/dist/integrations/base/rest-api-integration-client.d.ts +10 -20
- package/dist/integrations/base/rest-api-integration-client.d.ts.map +1 -1
- package/dist/integrations/base/rest-api-integration-client.js +10 -65
- package/dist/integrations/base/rest-api-integration-client.js.map +1 -1
- package/dist/integrations/box/types.d.ts +1 -1
- package/dist/integrations/declarations.d.ts +5 -63
- package/dist/integrations/declarations.d.ts.map +1 -1
- package/dist/integrations/declarations.js +5 -59
- package/dist/integrations/declarations.js.map +1 -1
- package/dist/integrations/documentation.test.js +0 -2
- package/dist/integrations/documentation.test.js.map +1 -1
- package/dist/integrations/googledrive/types.d.ts +1 -1
- package/dist/integrations/index.d.ts +1 -9
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +1 -6
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/registry.d.ts +1 -10
- package/dist/integrations/registry.d.ts.map +1 -1
- package/dist/integrations/registry.js +0 -25
- package/dist/integrations/registry.js.map +1 -1
- package/dist/integrations/slack/client.d.ts +13 -9
- package/dist/integrations/slack/client.d.ts.map +1 -1
- package/dist/integrations/slack/client.js +60 -8
- package/dist/integrations/slack/client.js.map +1 -1
- package/dist/integrations/slack/client.test.d.ts +11 -0
- package/dist/integrations/slack/client.test.d.ts.map +1 -0
- package/dist/integrations/slack/client.test.js +368 -0
- package/dist/integrations/slack/client.test.js.map +1 -0
- package/dist/integrations/slack/index.d.ts +2 -1
- package/dist/integrations/slack/index.d.ts.map +1 -1
- package/dist/integrations/slack/index.js +1 -0
- package/dist/integrations/slack/index.js.map +1 -1
- package/dist/integrations/slack/types.d.ts +127 -28
- package/dist/integrations/slack/types.d.ts.map +1 -1
- package/dist/integrations/slack/types.js +27 -1
- package/dist/integrations/slack/types.js.map +1 -1
- package/dist/integrations/snowflake/client.d.ts +2 -2
- package/dist/integrations/snowflake/client.js +2 -2
- package/dist/runtime/context.d.ts +1 -1
- package/dist/runtime/executor.d.ts +2 -2
- package/dist/types.d.ts +14 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/definition.test.ts +40 -15
- package/src/api/definition.ts +19 -12
- package/src/errors.ts +1 -1
- package/src/index.ts +13 -30
- package/src/integrations/asana/README.md +12 -12
- package/src/integrations/base/index.ts +2 -1
- package/src/integrations/base/rest-api-client-base.ts +134 -0
- package/src/integrations/base/rest-api-integration-client.ts +12 -89
- package/src/integrations/bitbucket/README.md +19 -19
- package/src/integrations/box/README.md +24 -24
- package/src/integrations/box/types.ts +1 -1
- package/src/integrations/circleci/README.md +18 -18
- package/src/integrations/declarations.ts +5 -91
- package/src/integrations/documentation.test.ts +0 -2
- package/src/integrations/googledrive/README.md +25 -22
- package/src/integrations/googledrive/types.ts +1 -1
- package/src/integrations/graphql/README.md +2 -2
- package/src/integrations/index.ts +0 -45
- package/src/integrations/registry.ts +1 -34
- package/src/integrations/salesforce/README.md +11 -9
- package/src/integrations/slack/README.md +62 -19
- package/src/integrations/slack/client.test.ts +553 -0
- package/src/integrations/slack/client.ts +92 -12
- package/src/integrations/slack/index.ts +6 -1
- package/src/integrations/slack/types.ts +142 -29
- package/src/integrations/snowflake/client.ts +2 -2
- package/src/integrations/zoom/README.md +15 -15
- package/src/runtime/context.ts +1 -1
- package/src/runtime/executor.ts +2 -2
- package/src/types.ts +14 -5
- package/dist/integrations/couchbase/client.d.ts +0 -36
- package/dist/integrations/couchbase/client.d.ts.map +0 -1
- package/dist/integrations/couchbase/client.js +0 -148
- package/dist/integrations/couchbase/client.js.map +0 -1
- package/dist/integrations/couchbase/index.d.ts +0 -8
- package/dist/integrations/couchbase/index.d.ts.map +0 -1
- package/dist/integrations/couchbase/index.js +0 -7
- package/dist/integrations/couchbase/index.js.map +0 -1
- package/dist/integrations/couchbase/types.d.ts +0 -100
- package/dist/integrations/couchbase/types.d.ts.map +0 -1
- package/dist/integrations/couchbase/types.js +0 -5
- package/dist/integrations/couchbase/types.js.map +0 -1
- package/dist/integrations/kafka/client.d.ts +0 -25
- package/dist/integrations/kafka/client.d.ts.map +0 -1
- package/dist/integrations/kafka/client.js +0 -124
- package/dist/integrations/kafka/client.js.map +0 -1
- package/dist/integrations/kafka/index.d.ts +0 -8
- package/dist/integrations/kafka/index.d.ts.map +0 -1
- package/dist/integrations/kafka/index.js +0 -7
- package/dist/integrations/kafka/index.js.map +0 -1
- package/dist/integrations/kafka/types.d.ts +0 -113
- package/dist/integrations/kafka/types.d.ts.map +0 -1
- package/dist/integrations/kafka/types.js +0 -5
- package/dist/integrations/kafka/types.js.map +0 -1
- package/dist/integrations/kinesis/client.d.ts +0 -31
- package/dist/integrations/kinesis/client.d.ts.map +0 -1
- package/dist/integrations/kinesis/client.js +0 -101
- package/dist/integrations/kinesis/client.js.map +0 -1
- package/dist/integrations/kinesis/index.d.ts +0 -8
- package/dist/integrations/kinesis/index.d.ts.map +0 -1
- package/dist/integrations/kinesis/index.js +0 -7
- package/dist/integrations/kinesis/index.js.map +0 -1
- package/dist/integrations/kinesis/types.d.ts +0 -97
- package/dist/integrations/kinesis/types.d.ts.map +0 -1
- package/dist/integrations/kinesis/types.js +0 -7
- package/dist/integrations/kinesis/types.js.map +0 -1
- package/dist/integrations/python/client.d.ts +0 -42
- package/dist/integrations/python/client.d.ts.map +0 -1
- package/dist/integrations/python/client.js +0 -89
- package/dist/integrations/python/client.js.map +0 -1
- package/dist/integrations/python/client.test.d.ts +0 -5
- package/dist/integrations/python/client.test.d.ts.map +0 -1
- package/dist/integrations/python/client.test.js +0 -214
- package/dist/integrations/python/client.test.js.map +0 -1
- package/dist/integrations/python/index.d.ts +0 -6
- package/dist/integrations/python/index.d.ts.map +0 -1
- package/dist/integrations/python/index.js +0 -5
- package/dist/integrations/python/index.js.map +0 -1
- package/dist/integrations/python/types.d.ts +0 -85
- package/dist/integrations/python/types.d.ts.map +0 -1
- package/dist/integrations/python/types.js +0 -5
- package/dist/integrations/python/types.js.map +0 -1
- package/src/integrations/couchbase/README.md +0 -138
- package/src/integrations/couchbase/client.ts +0 -225
- package/src/integrations/couchbase/index.ts +0 -8
- package/src/integrations/couchbase/types.ts +0 -126
- package/src/integrations/kafka/README.md +0 -144
- package/src/integrations/kafka/client.ts +0 -216
- package/src/integrations/kafka/index.ts +0 -14
- package/src/integrations/kafka/types.ts +0 -128
- package/src/integrations/kinesis/README.md +0 -153
- package/src/integrations/kinesis/client.ts +0 -146
- package/src/integrations/kinesis/index.ts +0 -14
- package/src/integrations/kinesis/types.ts +0 -114
- package/src/integrations/python/README.md +0 -566
- package/src/integrations/python/client.test.ts +0 -341
- package/src/integrations/python/client.ts +0 -136
- package/src/integrations/python/index.ts +0 -6
- package/src/integrations/python/types.ts +0 -92
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kinesis client types.
|
|
3
|
-
*
|
|
4
|
-
* Kinesis uses a dedicated plugin (not REST API) with PUT and GET operations.
|
|
5
|
-
*/
|
|
6
|
-
import type { BaseIntegrationClient } from "../../types.js";
|
|
7
|
-
import type { TraceMetadata } from "../registry.js";
|
|
8
|
-
/**
|
|
9
|
-
* Stream identifier type for Kinesis operations.
|
|
10
|
-
*/
|
|
11
|
-
export type KinesisStreamIdentifier = "STREAM_NAME" | "STREAM_ARN";
|
|
12
|
-
/**
|
|
13
|
-
* Shard iterator type for Kinesis GET operations.
|
|
14
|
-
*/
|
|
15
|
-
export type KinesisShardIteratorType = "AT_SEQUENCE_NUMBER" | "AFTER_SEQUENCE_NUMBER" | "AT_TIMESTAMP" | "TRIM_HORIZON" | "LATEST";
|
|
16
|
-
/**
|
|
17
|
-
* Parameters for a Kinesis PUT operation.
|
|
18
|
-
*/
|
|
19
|
-
export interface KinesisPutParams {
|
|
20
|
-
/** The data payload (JSON string or raw string) */
|
|
21
|
-
data: string;
|
|
22
|
-
/** The partition key for the record */
|
|
23
|
-
partitionKey: string;
|
|
24
|
-
/** How to identify the stream */
|
|
25
|
-
streamIdentifierType?: KinesisStreamIdentifier;
|
|
26
|
-
/** Stream name (when streamIdentifierType is STREAM_NAME) */
|
|
27
|
-
streamName?: string;
|
|
28
|
-
/** Stream ARN (when streamIdentifierType is STREAM_ARN) */
|
|
29
|
-
streamArn?: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Parameters for a Kinesis GET operation.
|
|
33
|
-
*/
|
|
34
|
-
export interface KinesisGetParams {
|
|
35
|
-
/** The shard ID to read from */
|
|
36
|
-
shardId: string;
|
|
37
|
-
/** How to position the shard iterator */
|
|
38
|
-
shardIteratorType: KinesisShardIteratorType;
|
|
39
|
-
/** Maximum number of records to return */
|
|
40
|
-
limit?: number;
|
|
41
|
-
/** Polling cooldown in milliseconds */
|
|
42
|
-
pollingCooldownMs?: number;
|
|
43
|
-
/** Starting sequence number (for AT/AFTER_SEQUENCE_NUMBER) */
|
|
44
|
-
startingSequenceNumber?: string;
|
|
45
|
-
/** Timestamp (for AT_TIMESTAMP) */
|
|
46
|
-
timestamp?: string;
|
|
47
|
-
/** How to identify the stream */
|
|
48
|
-
streamIdentifierType?: KinesisStreamIdentifier;
|
|
49
|
-
/** Stream name (when streamIdentifierType is STREAM_NAME) */
|
|
50
|
-
streamName?: string;
|
|
51
|
-
/** Stream ARN (when streamIdentifierType is STREAM_ARN) */
|
|
52
|
-
streamArn?: string;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Kinesis client for Amazon Kinesis Data Streams.
|
|
56
|
-
*
|
|
57
|
-
* Provides methods for putting records to and getting records from Kinesis streams.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```typescript
|
|
61
|
-
* // Declare in api(): integrations: { kinesis: kinesis(INTEGRATION_ID) }
|
|
62
|
-
* // In run(), access via ctx.integrations.kinesis
|
|
63
|
-
*
|
|
64
|
-
* // Put a record
|
|
65
|
-
* await kinesis.putRecord({
|
|
66
|
-
* data: JSON.stringify({ event: 'user_signup', userId: '123' }),
|
|
67
|
-
* partitionKey: 'user-123',
|
|
68
|
-
* streamName: 'user-events',
|
|
69
|
-
* });
|
|
70
|
-
*
|
|
71
|
-
* // Get records from a shard
|
|
72
|
-
* const records = await kinesis.getRecords({
|
|
73
|
-
* shardId: 'shardId-000000000000',
|
|
74
|
-
* shardIteratorType: 'LATEST',
|
|
75
|
-
* streamName: 'user-events',
|
|
76
|
-
* limit: 10,
|
|
77
|
-
* });
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
export interface KinesisClient extends BaseIntegrationClient {
|
|
81
|
-
/**
|
|
82
|
-
* Put a record to a Kinesis stream.
|
|
83
|
-
*
|
|
84
|
-
* @param params - PUT operation parameters
|
|
85
|
-
* @returns The raw result from Kinesis (includes ShardId and SequenceNumber)
|
|
86
|
-
*/
|
|
87
|
-
putRecord(params: KinesisPutParams, metadata?: TraceMetadata): Promise<unknown>;
|
|
88
|
-
/**
|
|
89
|
-
* Get records from a Kinesis stream shard.
|
|
90
|
-
*
|
|
91
|
-
* @param params - GET operation parameters
|
|
92
|
-
* @param metadata - Optional trace metadata for diagnostics
|
|
93
|
-
* @returns The raw result from Kinesis (includes Records array)
|
|
94
|
-
*/
|
|
95
|
-
getRecords(params: KinesisGetParams, metadata?: TraceMetadata): Promise<unknown>;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/integrations/kinesis/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG,YAAY,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,oBAAoB,GACpB,uBAAuB,GACvB,cAAc,GACd,cAAc,GACd,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,oBAAoB,CAAC,EAAE,uBAAuB,CAAC;IAC/C,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8DAA8D;IAC9D,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,oBAAoB,CAAC,EAAE,uBAAuB,CAAC;IAC/C,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IAC1D;;;;;OAKG;IACH,SAAS,CACP,MAAM,EAAE,gBAAgB,EACxB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB;;;;;;OAMG;IACH,UAAU,CACR,MAAM,EAAE,gBAAgB,EACxB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,OAAO,CAAC,CAAC;CACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/integrations/kinesis/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Python client implementation.
|
|
3
|
-
*
|
|
4
|
-
* Executes Python code via the orchestrator with type-safe bindings.
|
|
5
|
-
*/
|
|
6
|
-
import type { PartialMessage } from "@bufbuild/protobuf";
|
|
7
|
-
import type { z } from "zod";
|
|
8
|
-
import type { Plugin as PythonPlugin } from "@superblocksteam/types/dist/src/plugins/python/v1/plugin_pb";
|
|
9
|
-
import type { QueryExecutor, TraceMetadata } from "../registry.js";
|
|
10
|
-
import type { IntegrationConfig, IntegrationClientImpl } from "../types.js";
|
|
11
|
-
import type { PythonClient } from "./types.js";
|
|
12
|
-
/**
|
|
13
|
-
* Python plugin request type derived from proto definition.
|
|
14
|
-
* Using PartialMessage allows optional fields.
|
|
15
|
-
*/
|
|
16
|
-
export type PythonRequest = PartialMessage<PythonPlugin>;
|
|
17
|
-
/**
|
|
18
|
-
* Internal implementation of PythonClient.
|
|
19
|
-
*
|
|
20
|
-
* This implementation communicates with the orchestrator to execute Python code.
|
|
21
|
-
* The orchestrator handles {{}} binding resolution and script execution.
|
|
22
|
-
*/
|
|
23
|
-
export declare class PythonClientImpl implements PythonClient, IntegrationClientImpl {
|
|
24
|
-
readonly name: string;
|
|
25
|
-
readonly pluginId: string;
|
|
26
|
-
readonly config: IntegrationConfig;
|
|
27
|
-
private readonly executeQuery;
|
|
28
|
-
constructor(config: IntegrationConfig, executeQuery: QueryExecutor);
|
|
29
|
-
/**
|
|
30
|
-
* Build Python plugin request with injected bindings.
|
|
31
|
-
*
|
|
32
|
-
* Bindings are injected as Python variables in a preamble before the user code.
|
|
33
|
-
* This allows the user code to reference binding keys directly as Python variables.
|
|
34
|
-
*
|
|
35
|
-
* @param code - User's Python code string
|
|
36
|
-
* @param bindings - Bindings to inject as Python variables
|
|
37
|
-
* @returns Request object matching the proto schema with bindings injected
|
|
38
|
-
*/
|
|
39
|
-
private buildRequest;
|
|
40
|
-
run<T>(code: string, schema: z.ZodSchema<T>, bindings?: Record<string, unknown>, metadata?: TraceMetadata): Promise<T>;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/integrations/python/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,6DAA6D,CAAC;AAG1G,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,qBAAa,gBAAiB,YAAW,YAAY,EAAE,qBAAqB;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAEnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;gBAEjC,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa;IAOlE;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;IAqCd,GAAG,CAAC,CAAC,EACT,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,CAAC,CAAC;CAyCd"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Python client implementation.
|
|
3
|
-
*
|
|
4
|
-
* Executes Python code via the orchestrator with type-safe bindings.
|
|
5
|
-
*/
|
|
6
|
-
import { CodeExecutionError } from "../../errors.js";
|
|
7
|
-
/**
|
|
8
|
-
* Internal implementation of PythonClient.
|
|
9
|
-
*
|
|
10
|
-
* This implementation communicates with the orchestrator to execute Python code.
|
|
11
|
-
* The orchestrator handles {{}} binding resolution and script execution.
|
|
12
|
-
*/
|
|
13
|
-
export class PythonClientImpl {
|
|
14
|
-
name;
|
|
15
|
-
pluginId;
|
|
16
|
-
config;
|
|
17
|
-
executeQuery;
|
|
18
|
-
constructor(config, executeQuery) {
|
|
19
|
-
this.name = config.name;
|
|
20
|
-
this.pluginId = config.pluginId;
|
|
21
|
-
this.config = config;
|
|
22
|
-
this.executeQuery = executeQuery;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Build Python plugin request with injected bindings.
|
|
26
|
-
*
|
|
27
|
-
* Bindings are injected as Python variables in a preamble before the user code.
|
|
28
|
-
* This allows the user code to reference binding keys directly as Python variables.
|
|
29
|
-
*
|
|
30
|
-
* @param code - User's Python code string
|
|
31
|
-
* @param bindings - Bindings to inject as Python variables
|
|
32
|
-
* @returns Request object matching the proto schema with bindings injected
|
|
33
|
-
*/
|
|
34
|
-
buildRequest(code, bindings) {
|
|
35
|
-
// If no bindings, just return the code as-is
|
|
36
|
-
if (!bindings || Object.keys(bindings).length === 0) {
|
|
37
|
-
return {
|
|
38
|
-
body: code,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
// Inject bindings as Python variables using base64 to avoid string escaping issues.
|
|
42
|
-
// Format: import json,base64\n_bindings = json.loads(base64.b64decode('...').decode())\nvar1 = _bindings['var1']\n...\n\n<user code>
|
|
43
|
-
const bindingLines = ["import json, base64"];
|
|
44
|
-
// Base64-encode the JSON to avoid issues with special characters (\n, \t, \\, quotes)
|
|
45
|
-
// that JSON.stringify produces and Python's string parser would interpret
|
|
46
|
-
const bindingsB64 = Buffer.from(JSON.stringify(bindings)).toString("base64");
|
|
47
|
-
bindingLines.push(`_bindings = json.loads(base64.b64decode('${bindingsB64}').decode())`);
|
|
48
|
-
// Extract each binding as a local variable
|
|
49
|
-
for (const key of Object.keys(bindings)) {
|
|
50
|
-
bindingLines.push(`${key} = _bindings['${key}']`);
|
|
51
|
-
}
|
|
52
|
-
// Combine binding preamble with user code
|
|
53
|
-
const fullCode = `${bindingLines.join("\n")}\n\n${code}`;
|
|
54
|
-
return {
|
|
55
|
-
body: fullCode,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
async run(code, schema, bindings, metadata) {
|
|
59
|
-
// Build request with bindings injected as Python variables
|
|
60
|
-
const request = this.buildRequest(code, bindings);
|
|
61
|
-
try {
|
|
62
|
-
// Execute the Python code with injected bindings
|
|
63
|
-
// No need to pass bindings as input since they're already in the code
|
|
64
|
-
const result = await this.executeQuery(request, undefined, metadata);
|
|
65
|
-
// Validate result against schema
|
|
66
|
-
const parseResult = schema.safeParse(result);
|
|
67
|
-
if (!parseResult.success) {
|
|
68
|
-
throw new CodeExecutionError(`Python execution result validation failed: ${parseResult.error.message}`, {
|
|
69
|
-
code,
|
|
70
|
-
bindings,
|
|
71
|
-
result,
|
|
72
|
-
zodError: parseResult.error,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
return parseResult.data;
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
if (error instanceof CodeExecutionError) {
|
|
79
|
-
throw error;
|
|
80
|
-
}
|
|
81
|
-
throw new CodeExecutionError("Python execution failed", {
|
|
82
|
-
code,
|
|
83
|
-
bindings,
|
|
84
|
-
originalError: error,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/integrations/python/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAWrD;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAClB,IAAI,CAAS;IACb,QAAQ,CAAS;IACjB,MAAM,CAAoB;IAElB,YAAY,CAAgB;IAE7C,YAAY,MAAyB,EAAE,YAA2B;QAChE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;;;;;;;;OASG;IACK,YAAY,CAClB,IAAY,EACZ,QAAkC;QAElC,6CAA6C;QAC7C,IAAI,CAA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AC;gBACzB,MAAM,IAAI,kBAAkB,CAC1B,8CAA8C,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,EACzE;oBACE,IAAI;oBACJ,QAAQ;oBACR,MAAM;oBACN,QAAQ,EAAE,WAAW,CAAC,KAAK;iBAC5B,CACF,CAAC;YACJ,CAAC;YAED,OAAO,WAAW,CAAC,IAAI,CAAC;QAC1B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;gBACxC,MAAM,KAAK,CAAC;YACd,CAAC;YAED,MAAM,IAAI,kBAAkB,CAAC,yBAAyB,EAAE;gBACtD,IAAI;gBACJ,QAAQ;gBACR,aAAa,EAAE,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.test.d.ts","sourceRoot":"","sources":["../../../src/integrations/python/client.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Python client binding injection.
|
|
3
|
-
*/
|
|
4
|
-
import { describe, it, expect, vi } from "vitest";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { PythonClientImpl } from "./client.js";
|
|
7
|
-
/** Helper to compute expected base64-encoded json.loads preamble. */
|
|
8
|
-
function expectedBindingsLine(bindings) {
|
|
9
|
-
const b64 = Buffer.from(JSON.stringify(bindings)).toString("base64");
|
|
10
|
-
return `_bindings = json.loads(base64.b64decode('${b64}').decode())`;
|
|
11
|
-
}
|
|
12
|
-
describe("PythonClientImpl", () => {
|
|
13
|
-
const createMockConfig = () => ({
|
|
14
|
-
id: "test-python-id",
|
|
15
|
-
name: "Test Python",
|
|
16
|
-
pluginId: "python",
|
|
17
|
-
configuration: {},
|
|
18
|
-
});
|
|
19
|
-
const createMockExecutor = (mockResult) => {
|
|
20
|
-
return vi.fn().mockResolvedValue(mockResult);
|
|
21
|
-
};
|
|
22
|
-
describe("binding injection", () => {
|
|
23
|
-
it("generates code without bindings when none provided", async () => {
|
|
24
|
-
const mockExecutor = vi.fn().mockResolvedValue({ result: 42 });
|
|
25
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
26
|
-
await client.run('return {"result": 42}', z.object({ result: z.number() }));
|
|
27
|
-
expect(mockExecutor).toHaveBeenCalledWith({ body: 'return {"result": 42}' }, undefined, undefined);
|
|
28
|
-
});
|
|
29
|
-
it("injects string bindings as Python variables", async () => {
|
|
30
|
-
const mockExecutor = vi
|
|
31
|
-
.fn()
|
|
32
|
-
.mockResolvedValue({ message: "Hello World" });
|
|
33
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
34
|
-
const bindings = { greeting: "Hello World" };
|
|
35
|
-
await client.run('return {"message": greeting}', z.object({ message: z.string() }), bindings);
|
|
36
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
37
|
-
expect(request.body).toContain("import json, base64");
|
|
38
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
39
|
-
expect(request.body).toContain("greeting = _bindings['greeting']");
|
|
40
|
-
expect(request.body).toContain('return {"message": greeting}');
|
|
41
|
-
});
|
|
42
|
-
it("injects number bindings as Python variables", async () => {
|
|
43
|
-
const mockExecutor = vi.fn().mockResolvedValue({ result: 14 });
|
|
44
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
45
|
-
const bindings = { number: 10 };
|
|
46
|
-
await client.run('return {"result": number + 4}', z.object({ result: z.number() }), bindings);
|
|
47
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
48
|
-
expect(request.body).toContain("import json, base64");
|
|
49
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
50
|
-
expect(request.body).toContain("number = _bindings['number']");
|
|
51
|
-
expect(request.body).toContain('return {"result": number + 4}');
|
|
52
|
-
});
|
|
53
|
-
it("injects boolean bindings as Python variables", async () => {
|
|
54
|
-
const mockExecutor = vi.fn().mockResolvedValue({ active: true });
|
|
55
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
56
|
-
const bindings = { isActive: true };
|
|
57
|
-
await client.run('return {"active": isActive}', z.object({ active: z.boolean() }), bindings);
|
|
58
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
59
|
-
expect(request.body).toContain("import json, base64");
|
|
60
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
61
|
-
expect(request.body).toContain("isActive = _bindings['isActive']");
|
|
62
|
-
expect(request.body).toContain('return {"active": isActive}');
|
|
63
|
-
});
|
|
64
|
-
it("injects null bindings as Python variables", async () => {
|
|
65
|
-
const mockExecutor = vi.fn().mockResolvedValue({ value: null });
|
|
66
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
67
|
-
const bindings = { nullValue: null };
|
|
68
|
-
await client.run('return {"value": nullValue}', z.object({ value: z.null() }), bindings);
|
|
69
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
70
|
-
expect(request.body).toContain("import json, base64");
|
|
71
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
72
|
-
expect(request.body).toContain("nullValue = _bindings['nullValue']");
|
|
73
|
-
expect(request.body).toContain('return {"value": nullValue}');
|
|
74
|
-
});
|
|
75
|
-
it("injects array bindings as Python variables", async () => {
|
|
76
|
-
const mockExecutor = vi.fn().mockResolvedValue({ count: 3 });
|
|
77
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
78
|
-
const bindings = { items: [1, 2, 3] };
|
|
79
|
-
await client.run('return {"count": len(items)}', z.object({ count: z.number() }), bindings);
|
|
80
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
81
|
-
expect(request.body).toContain("import json, base64");
|
|
82
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
83
|
-
expect(request.body).toContain("items = _bindings['items']");
|
|
84
|
-
expect(request.body).toContain('return {"count": len(items)}');
|
|
85
|
-
});
|
|
86
|
-
it("injects object bindings as Python variables", async () => {
|
|
87
|
-
const mockExecutor = vi.fn().mockResolvedValue({ name: "John" });
|
|
88
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
89
|
-
const bindings = { user: { name: "John", age: 30 } };
|
|
90
|
-
await client.run('return {"name": user["name"]}', z.object({ name: z.string() }), bindings);
|
|
91
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
92
|
-
expect(request.body).toContain("import json, base64");
|
|
93
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
94
|
-
expect(request.body).toContain("user = _bindings['user']");
|
|
95
|
-
expect(request.body).toContain('return {"name": user["name"]}');
|
|
96
|
-
});
|
|
97
|
-
it("injects multiple bindings as Python variables", async () => {
|
|
98
|
-
const mockExecutor = vi
|
|
99
|
-
.fn()
|
|
100
|
-
.mockResolvedValue({ message: "Alice is 25 years old" });
|
|
101
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
102
|
-
const bindings = { userName: "Alice", userAge: 25 };
|
|
103
|
-
await client.run('return {"message": f"{userName} is {userAge} years old"}', z.object({ message: z.string() }), bindings);
|
|
104
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
105
|
-
expect(request.body).toContain("import json, base64");
|
|
106
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
107
|
-
expect(request.body).toContain("userName = _bindings['userName']");
|
|
108
|
-
expect(request.body).toContain("userAge = _bindings['userAge']");
|
|
109
|
-
expect(request.body).toContain('return {"message": f"{userName} is {userAge} years old"}');
|
|
110
|
-
});
|
|
111
|
-
it("handles strings with special characters", async () => {
|
|
112
|
-
const mockExecutor = vi
|
|
113
|
-
.fn()
|
|
114
|
-
.mockResolvedValue({ text: 'It\'s a "test"' });
|
|
115
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
116
|
-
const bindings = { text: 'It\'s a "test"' };
|
|
117
|
-
await client.run('return {"text": text}', z.object({ text: z.string() }), bindings);
|
|
118
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
119
|
-
expect(request.body).toContain("import json, base64");
|
|
120
|
-
// Base64 encoding avoids all string escaping issues
|
|
121
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
122
|
-
expect(request.body).toContain("text = _bindings['text']");
|
|
123
|
-
expect(request.body).toContain('return {"text": text}');
|
|
124
|
-
});
|
|
125
|
-
it("handles strings with newlines and tabs", async () => {
|
|
126
|
-
const mockExecutor = vi
|
|
127
|
-
.fn()
|
|
128
|
-
.mockResolvedValue({ text: "line1\nline2\ttab" });
|
|
129
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
130
|
-
const bindings = { text: "line1\nline2\ttab" };
|
|
131
|
-
await client.run('return {"text": text}', z.object({ text: z.string() }), bindings);
|
|
132
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
133
|
-
// Base64 encoding handles newlines/tabs safely
|
|
134
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
135
|
-
expect(request.body).toContain("text = _bindings['text']");
|
|
136
|
-
});
|
|
137
|
-
it("handles strings with backslashes", async () => {
|
|
138
|
-
const mockExecutor = vi
|
|
139
|
-
.fn()
|
|
140
|
-
.mockResolvedValue({ path: "C:\\Users\\test" });
|
|
141
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
142
|
-
const bindings = { path: "C:\\Users\\test" };
|
|
143
|
-
await client.run('return {"path": path}', z.object({ path: z.string() }), bindings);
|
|
144
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
145
|
-
// Base64 encoding handles backslashes safely
|
|
146
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
147
|
-
expect(request.body).toContain("path = _bindings['path']");
|
|
148
|
-
});
|
|
149
|
-
it("preserves code structure with blank line between preamble and user code", async () => {
|
|
150
|
-
const mockExecutor = vi.fn().mockResolvedValue({ result: 42 });
|
|
151
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
152
|
-
const bindings = { number: 21 };
|
|
153
|
-
await client.run('result = number * 2\nreturn {"result": result}', z.object({ result: z.number() }), bindings);
|
|
154
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
155
|
-
const lines = request.body.split("\n");
|
|
156
|
-
// Should have: import, _bindings assignment, variable extraction, blank line, then user code
|
|
157
|
-
expect(lines[0]).toBe("import json, base64");
|
|
158
|
-
expect(lines[1]).toBe(expectedBindingsLine(bindings));
|
|
159
|
-
expect(lines[2]).toBe("number = _bindings['number']");
|
|
160
|
-
expect(lines[3]).toBe("");
|
|
161
|
-
expect(lines[4]).toBe("result = number * 2");
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
describe("validation", () => {
|
|
165
|
-
it("validates result against schema", async () => {
|
|
166
|
-
const mockExecutor = createMockExecutor({ result: 42 });
|
|
167
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
168
|
-
const result = await client.run('return {"result": 42}', z.object({ result: z.number() }));
|
|
169
|
-
expect(result).toEqual({ result: 42 });
|
|
170
|
-
});
|
|
171
|
-
it("throws CodeExecutionError when validation fails", async () => {
|
|
172
|
-
const mockExecutor = createMockExecutor({ result: "not a number" });
|
|
173
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
174
|
-
await expect(client.run('return {"result": "not a number"}', z.object({ result: z.number() }))).rejects.toThrow("Python execution result validation failed");
|
|
175
|
-
});
|
|
176
|
-
it("throws CodeExecutionError when execution fails", async () => {
|
|
177
|
-
const mockExecutor = vi
|
|
178
|
-
.fn()
|
|
179
|
-
.mockRejectedValue(new Error("Execution error"));
|
|
180
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
181
|
-
await expect(client.run('return {"result": 42}', z.object({ result: z.number() }))).rejects.toThrow("Python execution failed");
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
describe("complex bindings", () => {
|
|
185
|
-
it("handles nested objects", async () => {
|
|
186
|
-
const mockExecutor = vi.fn().mockResolvedValue({ name: "John Doe" });
|
|
187
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
188
|
-
const bindings = {
|
|
189
|
-
person: { first: "John", last: "Doe", address: { city: "NYC" } },
|
|
190
|
-
};
|
|
191
|
-
await client.run("return {\"name\": f\"{person['first']} {person['last']}\"}", z.object({ name: z.string() }), bindings);
|
|
192
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
193
|
-
expect(request.body).toContain("import json, base64");
|
|
194
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
195
|
-
expect(request.body).toContain("person = _bindings['person']");
|
|
196
|
-
});
|
|
197
|
-
it("handles arrays of objects", async () => {
|
|
198
|
-
const mockExecutor = vi.fn().mockResolvedValue({ count: 2 });
|
|
199
|
-
const client = new PythonClientImpl(createMockConfig(), mockExecutor);
|
|
200
|
-
const bindings = {
|
|
201
|
-
users: [
|
|
202
|
-
{ id: 1, name: "Alice" },
|
|
203
|
-
{ id: 2, name: "Bob" },
|
|
204
|
-
],
|
|
205
|
-
};
|
|
206
|
-
await client.run('return {"count": len(users)}', z.object({ count: z.number() }), bindings);
|
|
207
|
-
const request = mockExecutor.mock.calls[0][0];
|
|
208
|
-
expect(request.body).toContain("import json, base64");
|
|
209
|
-
expect(request.body).toContain(expectedBindingsLine(bindings));
|
|
210
|
-
expect(request.body).toContain("users = _bindings['users']");
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
//# sourceMappingURL=client.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.test.js","sourceRoot":"","sources":["../../../src/integrations/python/client.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,qEAAqE;AACrE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SAAS,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC/D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/python/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/python/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Python code execution client types.
|
|
3
|
-
*/
|
|
4
|
-
import type { z } from "zod";
|
|
5
|
-
import type { BaseIntegrationClient } from "../../types.js";
|
|
6
|
-
import type { TraceMetadata } from "../registry.js";
|
|
7
|
-
/**
|
|
8
|
-
* Python code execution client.
|
|
9
|
-
*
|
|
10
|
-
* Executes Python scripts with type-safe inputs and outputs.
|
|
11
|
-
* Bindings are passed as a map and referenced in code using {{key}} syntax.
|
|
12
|
-
* The orchestrator resolves bindings before execution.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* // Declare in api(): integrations: { runtime: python(INTEGRATION_ID) }
|
|
17
|
-
* // In run(), access via: ctx.integrations.runtime
|
|
18
|
-
* const result = await ctx.integrations.runtime.run(
|
|
19
|
-
* `
|
|
20
|
-
* import time
|
|
21
|
-
*
|
|
22
|
-
* user_id = {{userId}}
|
|
23
|
-
* current_time = int(time.time())
|
|
24
|
-
*
|
|
25
|
-
* return {
|
|
26
|
-
* "greeting": f"Hello user {user_id}!",
|
|
27
|
-
* "timestamp": current_time
|
|
28
|
-
* }
|
|
29
|
-
* `,
|
|
30
|
-
* z.object({
|
|
31
|
-
* greeting: z.string(),
|
|
32
|
-
* timestamp: z.number(),
|
|
33
|
-
* }),
|
|
34
|
-
* {
|
|
35
|
-
* userId,
|
|
36
|
-
* }
|
|
37
|
-
* );
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export interface PythonClient extends BaseIntegrationClient {
|
|
41
|
-
/**
|
|
42
|
-
* Execute Python code with validated output.
|
|
43
|
-
*
|
|
44
|
-
* The Python code must return a value using a `return` statement.
|
|
45
|
-
* Bindings are referenced using {{key}} syntax and resolved by the
|
|
46
|
-
* orchestrator before execution.
|
|
47
|
-
*
|
|
48
|
-
* **Important:** The parameter order is `(code, schema, bindings?, metadata?)`.
|
|
49
|
-
* Because `bindings` is `Record<string, unknown>`, it is structurally
|
|
50
|
-
* compatible with `TraceMetadata`. Take care not to pass a metadata object
|
|
51
|
-
* as the third argument -- if you only need metadata and no bindings, pass
|
|
52
|
-
* `undefined` for `bindings` explicitly:
|
|
53
|
-
*
|
|
54
|
-
* ```typescript
|
|
55
|
-
* // Correct: skip bindings, pass metadata
|
|
56
|
-
* await python.run(code, schema, undefined, { label: "my label" });
|
|
57
|
-
*
|
|
58
|
-
* // Wrong: metadata is accidentally treated as bindings
|
|
59
|
-
* await python.run(code, schema, { label: "my label" });
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @param code - Python script to execute (use {{key}} for bindings)
|
|
63
|
-
* @param schema - Zod schema for validating the return value
|
|
64
|
-
* @param bindings - Optional key/value pairs accessible via {{key}} in code.
|
|
65
|
-
* Do not pass `TraceMetadata` here; use the `metadata` parameter instead.
|
|
66
|
-
* @param metadata - Optional trace metadata for diagnostics labeling
|
|
67
|
-
* @returns Validated result matching the schema
|
|
68
|
-
*
|
|
69
|
-
* @throws {CodeExecutionError} If execution fails or validation fails
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```typescript
|
|
73
|
-
* const result = await python.run(
|
|
74
|
-
* `
|
|
75
|
-
* user_id = {{userId}}
|
|
76
|
-
* return {"message": f"Hello {user_id}"}
|
|
77
|
-
* `,
|
|
78
|
-
* z.object({ message: z.string() }),
|
|
79
|
-
* { userId: "123" }
|
|
80
|
-
* );
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
run<T>(code: string, schema: z.ZodSchema<T>, bindings?: Record<string, unknown>, metadata?: TraceMetadata): Promise<T>;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/integrations/python/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,YAAa,SAAQ,qBAAqB;IACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,GAAG,CAAC,CAAC,EACH,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,CAAC,CAAC,CAAC;CACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/integrations/python/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|