@pikku/addon-graph 0.0.1 → 0.0.3
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/.pikku/addon/pikku-addon-types.gen.d.ts +17 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +21 -2
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +24 -2
- package/dist/.pikku/addon/pikku-package.gen.js +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +1 -1
- package/{.pikku/console/pikku-nodes-meta.gen.json → dist/.pikku/console/pikku-addon-meta.gen.json} +12 -9
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +2 -2
- package/dist/.pikku/console/pikku-node-types.gen.d.ts.map +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.ts +2 -2
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +41 -12
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +17 -1
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +53 -15
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +28 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +16 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +3 -1
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions.gen.ts +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.ts +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +3 -1
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +2 -0
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +3 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-types.gen.ts +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +50 -396
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +51 -396
- package/dist/.pikku/schema-cache.json +1 -0
- package/dist/.pikku/schemas/pikku.cache.json +1 -0
- package/dist/.pikku/schemas/register.gen.js +3 -1
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/register.gen.ts +5 -1
- package/dist/.pikku/schemas/schemas/SleepInput.schema.json +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +35 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +65 -9
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/src/functions/data/sleep.function.d.ts +16 -0
- package/dist/src/functions/data/sleep.function.d.ts.map +1 -0
- package/dist/src/functions/data/sleep.function.js +18 -0
- package/dist/src/functions/data/sleep.function.js.map +1 -0
- package/package.json +13 -10
- package/.pikku/addon/pikku-addon-types.gen.ts +0 -78
- package/.pikku/addon/pikku-package.gen.ts +0 -9
- package/.pikku/agent/pikku-agent-map.gen.d.ts +0 -16
- package/.pikku/agent/pikku-agent-types.gen.ts +0 -76
- package/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
- package/.pikku/console/pikku-node-types.gen.ts +0 -8
- package/.pikku/function/pikku-function-types.gen.ts +0 -648
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +0 -582
- package/.pikku/function/pikku-functions-meta.gen.json +0 -434
- package/.pikku/function/pikku-functions-meta.gen.ts +0 -7
- package/.pikku/function/pikku-functions.gen.ts +0 -54
- package/.pikku/pikku-bootstrap.gen.ts +0 -15
- package/.pikku/pikku-services.gen.ts +0 -32
- package/.pikku/pikku-types.gen.ts +0 -21
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +0 -470
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +0 -494
- package/.pikku/schemas/register.gen.ts +0 -195
- package/.pikku/schemas/schemas/AggregateInput.schema.json +0 -1
- package/.pikku/schemas/schemas/AggregateOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/ChunkInput.schema.json +0 -1
- package/.pikku/schemas/schemas/ChunkOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/CoalesceInput.schema.json +0 -1
- package/.pikku/schemas/schemas/CoalesceOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/CryptoInput.schema.json +0 -1
- package/.pikku/schemas/schemas/CryptoOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/DateTimeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/DateTimeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/EditFieldsInput.schema.json +0 -1
- package/.pikku/schemas/schemas/EditFieldsOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/FindInput.schema.json +0 -1
- package/.pikku/schemas/schemas/FindOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/GroupByInput.schema.json +0 -1
- package/.pikku/schemas/schemas/GroupByOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtDecodeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtSignInput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtSignOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/LimitInput.schema.json +0 -1
- package/.pikku/schemas/schemas/LimitOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/MathInput.schema.json +0 -1
- package/.pikku/schemas/schemas/MathOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/MergeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/MergeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/OmitInput.schema.json +0 -1
- package/.pikku/schemas/schemas/OmitOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/PickInput.schema.json +0 -1
- package/.pikku/schemas/schemas/PickOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +0 -1
- package/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/RenameKeysInput.schema.json +0 -1
- package/.pikku/schemas/schemas/RenameKeysOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/ReverseInput.schema.json +0 -1
- package/.pikku/schemas/schemas/ReverseOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/SortInput.schema.json +0 -1
- package/.pikku/schemas/schemas/SortOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/SplitOutInput.schema.json +0 -1
- package/.pikku/schemas/schemas/SplitOutOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/StringTransformInput.schema.json +0 -1
- package/.pikku/schemas/schemas/StringTransformOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/SummarizeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/SummarizeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/TypeConvertInput.schema.json +0 -1
- package/.pikku/schemas/schemas/TypeConvertOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/UniqueInput.schema.json +0 -1
- package/.pikku/schemas/schemas/UniqueOutput.schema.json +0 -1
- package/.pikku/secrets/pikku-secret-types.gen.ts +0 -5
- package/.pikku/secrets/pikku-secrets-meta.gen.json +0 -1
- package/.pikku/secrets/pikku-secrets.gen.ts +0 -21
- package/.pikku/trigger/pikku-trigger-types.gen.ts +0 -160
- package/.pikku/variables/pikku-variable-types.gen.ts +0 -5
- package/.pikku/variables/pikku-variables-meta.gen.json +0 -1
- package/.pikku/variables/pikku-variables.gen.ts +0 -21
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +0 -34
- package/.pikku/workflow/pikku-workflow-types.gen.ts +0 -158
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +0 -9
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +0 -3
- package/dist/.pikku/console/pikku-nodes-meta.gen.json +0 -278
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.8
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow';
|
|
5
5
|
import { template } from '@pikku/core/workflow';
|
|
@@ -7,16 +7,46 @@ import { type PikkuWorkflowGraphConfig, type PikkuWorkflowGraphResult } from '@p
|
|
|
7
7
|
import type { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow';
|
|
8
8
|
export { WorkflowCancelledException };
|
|
9
9
|
import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js';
|
|
11
11
|
import type { WorkflowMap, GraphsMap } from './pikku-workflow-map.gen.d.js';
|
|
12
12
|
export { template };
|
|
13
13
|
export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
14
|
-
do<K extends keyof
|
|
14
|
+
do<K extends keyof FlattenedRPCMap>(stepName: string, rpcName: K, data: FlattenedRPCMap[K]['input'], options?: WorkflowStepOptions): Promise<FlattenedRPCMap[K]['output']>;
|
|
15
|
+
do<K extends keyof WorkflowMap>(stepName: string, workflowName: K, data: WorkflowMap[K]['input'], options?: WorkflowStepOptions): Promise<WorkflowMap[K]['output']>;
|
|
15
16
|
do<T>(stepName: string, fn: () => T | Promise<T>, options?: WorkflowStepOptions): Promise<T>;
|
|
16
17
|
}
|
|
18
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
19
|
+
import type { InferSchemaOutput, PikkuPermission, PikkuMiddleware, NodeConfig, PikkuApprovalDescription } from '../function/pikku-function-types.gen.js';
|
|
20
|
+
import { PikkuError } from '@pikku/core/errors';
|
|
21
|
+
import type { CorePermissionGroup } from '@pikku/core';
|
|
17
22
|
export type PikkuFunctionWorkflow<In = unknown, Out = never> = PikkuFunctionSessionless<In, Out, 'workflow'>;
|
|
18
|
-
export
|
|
19
|
-
|
|
23
|
+
export type PikkuWorkflowConfigWithSchema<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = {
|
|
24
|
+
title?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
tags?: string[];
|
|
27
|
+
expose?: boolean;
|
|
28
|
+
internal?: boolean;
|
|
29
|
+
override?: string;
|
|
30
|
+
version?: number;
|
|
31
|
+
remote?: boolean;
|
|
32
|
+
mcp?: boolean;
|
|
33
|
+
readonly?: boolean;
|
|
34
|
+
approvalRequired?: boolean;
|
|
35
|
+
approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never;
|
|
36
|
+
func: PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>;
|
|
37
|
+
auth?: boolean;
|
|
38
|
+
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined;
|
|
39
|
+
middleware?: PikkuMiddleware[];
|
|
40
|
+
input?: InputSchema;
|
|
41
|
+
output?: OutputSchema;
|
|
42
|
+
node?: NodeConfig;
|
|
43
|
+
errors?: Array<typeof PikkuError>;
|
|
44
|
+
inline?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare function pikkuWorkflowFunc<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>;
|
|
47
|
+
export declare function pikkuWorkflowFunc<In, Out = unknown>(func: PikkuFunctionWorkflow<In, Out> | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>): PikkuFunctionConfig<In, Out, 'workflow'>;
|
|
48
|
+
export declare function pikkuWorkflowComplexFunc<InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>;
|
|
49
|
+
export declare function pikkuWorkflowComplexFunc<In, Out = unknown>(func: PikkuFunctionWorkflow<In, Out> | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>): PikkuFunctionConfig<In, Out, 'workflow'>;
|
|
20
50
|
type TypedRef<T> = {
|
|
21
51
|
$ref: string;
|
|
22
52
|
path?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-workflow-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AAOjE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAElF,OAAO,EAAE,0BAA0B,EAAE,CAAA;AACrC,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC5G,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pikku-workflow-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AAOjE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAElF,OAAO,EAAE,0BAA0B,EAAE,CAAA;AACrC,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAA;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAA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AAED,eAAO,MAAM,cAAc,GAAI,IAAI,SAAS,MAAM,WAAW,EAC3D,eAAe,IAAI,KAEoE,mBAAmB,CACxG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACjB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAC5I,SAAS,GAAG,KAAK,CAEpB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,IAAI,SAAS,MAAM,SAAS,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,EAClG,WAAW,IAAI,EACf,WAAW,IAAI,KAEiF,mBAAmB,CACjH,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,KAAK,EAC5D;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACjB,SAAS,GAAG,KAAK,CAEpB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.8
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow';
|
|
5
5
|
import { workflow as coreWorkflow, workflowStart as coreWorkflowStart, workflowStatus as coreWorkflowStatus, graphStart as coreGraphStart, } from '@pikku/core/workflow';
|
|
@@ -7,12 +7,12 @@ import { template } from '@pikku/core/workflow';
|
|
|
7
7
|
import { pikkuWorkflowGraph as corePikkuWorkflowGraph, } from '@pikku/core/workflow';
|
|
8
8
|
export { WorkflowCancelledException };
|
|
9
9
|
export { template };
|
|
10
|
-
export
|
|
10
|
+
export function pikkuWorkflowFunc(func) {
|
|
11
11
|
return typeof func === 'function' ? { func } : func;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
12
|
+
}
|
|
13
|
+
export function pikkuWorkflowComplexFunc(func) {
|
|
14
14
|
return typeof func === 'function' ? { func } : func;
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
export function pikkuWorkflowGraph(config) {
|
|
17
17
|
return corePikkuWorkflowGraph(config);
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-workflow-types.gen.js","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,aAAa,IAAI,iBAAiB,EAClC,cAAc,IAAI,kBAAkB,EACpC,UAAU,IAAI,cAAc,GAC7B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EACL,kBAAkB,IAAI,sBAAsB,GAG7C,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,0BAA0B,EAAE,CAAA;AAKrC,OAAO,EAAE,QAAQ,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"pikku-workflow-types.gen.js","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-workflow-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,aAAa,IAAI,iBAAiB,EAClC,cAAc,IAAI,kBAAkB,EACpC,UAAU,IAAI,cAAc,GAC7B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EACL,kBAAkB,IAAI,sBAAsB,GAG7C,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,0BAA0B,EAAE,CAAA;AAKrC,OAAO,EAAE,QAAQ,EAAE,CAAA;AA2EnB,MAAM,UAAU,iBAAiB,CAAC,IAAS;IACzC,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC;AAaD,MAAM,UAAU,wBAAwB,CAAC,IAAS;IAChD,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC;AAkDD,MAAM,UAAU,kBAAkB,CAGhC,MAAsE;IAEtE,OAAO,sBAAsB,CAAC,MAAa,CAAC,CAAA;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,YAAkB,EAClB,OAAqC,EACrC,EAAE;IACF,OAAO,YAAY,CAAc,YAA0C,EAAE,OAAO,CAInF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,YAAkB,EAClB,EAAE;IACF,OAAO,iBAAiB,CAAc,YAA0C,CAI/E,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,aAAmB,EACnB,EAAE;IACF,OAAO,kBAAkB,CAAc,aAA2C,CAIjF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,SAAe,EACf,SAAe,EACf,EAAE;IACF,OAAO,cAAc,CAAY,SAAqC,EAAE,SAAmB,CAI1F,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.8
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow'
|
|
5
5
|
import {
|
|
@@ -18,18 +18,25 @@ import type { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflo
|
|
|
18
18
|
|
|
19
19
|
export { WorkflowCancelledException }
|
|
20
20
|
import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
|
|
21
|
-
import type {
|
|
21
|
+
import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
|
22
22
|
import type { WorkflowMap, GraphsMap } from './pikku-workflow-map.gen.d.js'
|
|
23
23
|
|
|
24
24
|
export { template }
|
|
25
25
|
|
|
26
26
|
export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
27
|
-
do<K extends keyof
|
|
27
|
+
do<K extends keyof FlattenedRPCMap>(
|
|
28
28
|
stepName: string,
|
|
29
29
|
rpcName: K,
|
|
30
|
-
data:
|
|
30
|
+
data: FlattenedRPCMap[K]['input'],
|
|
31
31
|
options?: WorkflowStepOptions
|
|
32
|
-
): Promise<
|
|
32
|
+
): Promise<FlattenedRPCMap[K]['output']>
|
|
33
|
+
|
|
34
|
+
do<K extends keyof WorkflowMap>(
|
|
35
|
+
stepName: string,
|
|
36
|
+
workflowName: K,
|
|
37
|
+
data: WorkflowMap[K]['input'],
|
|
38
|
+
options?: WorkflowStepOptions
|
|
39
|
+
): Promise<WorkflowMap[K]['output']>
|
|
33
40
|
|
|
34
41
|
do<T>(
|
|
35
42
|
stepName: string,
|
|
@@ -38,24 +45,73 @@ export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
|
38
45
|
): Promise<T>
|
|
39
46
|
}
|
|
40
47
|
|
|
48
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
49
|
+
import type { InferSchemaOutput, PikkuPermission, PikkuMiddleware, NodeConfig, PikkuApprovalDescription } from '../function/pikku-function-types.gen.js'
|
|
50
|
+
import { PikkuError } from '@pikku/core/errors'
|
|
51
|
+
import type { CorePermissionGroup } from '@pikku/core'
|
|
52
|
+
|
|
41
53
|
export type PikkuFunctionWorkflow<
|
|
42
54
|
In = unknown,
|
|
43
55
|
Out = never
|
|
44
56
|
> = PikkuFunctionSessionless<In, Out, 'workflow'>
|
|
45
57
|
|
|
46
|
-
export
|
|
58
|
+
export type PikkuWorkflowConfigWithSchema<
|
|
59
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
60
|
+
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
61
|
+
> = {
|
|
62
|
+
title?: string
|
|
63
|
+
description?: string
|
|
64
|
+
tags?: string[]
|
|
65
|
+
expose?: boolean
|
|
66
|
+
internal?: boolean
|
|
67
|
+
override?: string
|
|
68
|
+
version?: number
|
|
69
|
+
remote?: boolean
|
|
70
|
+
mcp?: boolean
|
|
71
|
+
readonly?: boolean
|
|
72
|
+
approvalRequired?: boolean
|
|
73
|
+
approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
|
|
74
|
+
func: PikkuFunctionWorkflow<
|
|
75
|
+
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
76
|
+
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
|
|
77
|
+
>
|
|
78
|
+
auth?: boolean
|
|
79
|
+
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
|
|
80
|
+
middleware?: PikkuMiddleware[]
|
|
81
|
+
input?: InputSchema
|
|
82
|
+
output?: OutputSchema
|
|
83
|
+
node?: NodeConfig
|
|
84
|
+
errors?: Array<typeof PikkuError>
|
|
85
|
+
inline?: boolean
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function pikkuWorkflowFunc<
|
|
89
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
90
|
+
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
91
|
+
>(
|
|
92
|
+
config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
|
|
93
|
+
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
|
|
94
|
+
export function pikkuWorkflowFunc<In, Out = unknown>(
|
|
47
95
|
func:
|
|
48
96
|
| PikkuFunctionWorkflow<In, Out>
|
|
49
97
|
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
50
|
-
)
|
|
98
|
+
): PikkuFunctionConfig<In, Out, 'workflow'>
|
|
99
|
+
export function pikkuWorkflowFunc(func: any) {
|
|
51
100
|
return typeof func === 'function' ? { func } : func
|
|
52
101
|
}
|
|
53
102
|
|
|
54
|
-
export
|
|
103
|
+
export function pikkuWorkflowComplexFunc<
|
|
104
|
+
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
105
|
+
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
106
|
+
>(
|
|
107
|
+
config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
|
|
108
|
+
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
|
|
109
|
+
export function pikkuWorkflowComplexFunc<In, Out = unknown>(
|
|
55
110
|
func:
|
|
56
111
|
| PikkuFunctionWorkflow<In, Out>
|
|
57
112
|
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
58
|
-
)
|
|
113
|
+
): PikkuFunctionConfig<In, Out, 'workflow'>
|
|
114
|
+
export function pikkuWorkflowComplexFunc(func: any) {
|
|
59
115
|
return typeof func === 'function' ? { func } : func
|
|
60
116
|
}
|
|
61
117
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SleepInput: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
ms: z.ZodNumber;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const sleep: import("#pikku").PikkuFunctionConfig<{
|
|
7
|
+
name: string;
|
|
8
|
+
ms: number;
|
|
9
|
+
}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
|
|
10
|
+
name: string;
|
|
11
|
+
ms: number;
|
|
12
|
+
}, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{
|
|
13
|
+
name: string;
|
|
14
|
+
ms: number;
|
|
15
|
+
}, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
16
|
+
//# sourceMappingURL=sleep.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.function.d.ts","sourceRoot":"","sources":["../../../../src/functions/data/sleep.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,UAAU;;;iBAGrB,CAAA;AAEF,eAAO,MAAM,KAAK;;;;;;;;;6EAShB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { pikkuSessionlessFunc } from '#pikku';
|
|
3
|
+
export const SleepInput = z.object({
|
|
4
|
+
name: z.string().describe('A unique name for this sleep step'),
|
|
5
|
+
ms: z.number().describe('Duration to sleep in milliseconds'),
|
|
6
|
+
});
|
|
7
|
+
export const sleep = pikkuSessionlessFunc({
|
|
8
|
+
description: 'Sleep for a specified duration before continuing',
|
|
9
|
+
node: { displayName: 'Sleep', category: 'Data', type: 'action' },
|
|
10
|
+
input: SleepInput,
|
|
11
|
+
output: z.void(),
|
|
12
|
+
func: async (_services, data, { workflow }) => {
|
|
13
|
+
if (!workflow)
|
|
14
|
+
throw new Error('sleep can only be called from within a workflow');
|
|
15
|
+
await workflow.sleep(data.name, `${data.ms}ms`);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=sleep.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.function.js","sourceRoot":"","sources":["../../../../src/functions/data/sleep.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAC9D,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CAC7D,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,oBAAoB,CAAC;IACxC,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChE,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE;IAChB,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC5C,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAA;QACjF,MAAM,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;IACjD,CAAC;CACF,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/addon-graph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
|
-
"#pikku":
|
|
6
|
+
"#pikku": {
|
|
7
|
+
"types": "./.pikku/pikku-types.gen.ts",
|
|
8
|
+
"import": "./dist/.pikku/pikku-types.gen.js"
|
|
9
|
+
}
|
|
7
10
|
},
|
|
8
11
|
"exports": {
|
|
9
12
|
".": {
|
|
10
13
|
"types": "./dist/src/index.d.ts",
|
|
11
14
|
"import": "./dist/src/index.js"
|
|
12
15
|
},
|
|
13
|
-
"./.pikku/*": "
|
|
14
|
-
"./.pikku/pikku-metadata.gen.json": "
|
|
16
|
+
"./.pikku/*": "./dist/.pikku/*",
|
|
17
|
+
"./.pikku/pikku-metadata.gen.json": "./dist/.pikku/pikku-metadata.gen.json",
|
|
15
18
|
"./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.js": {
|
|
16
|
-
"types": "
|
|
19
|
+
"types": "./dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts"
|
|
17
20
|
}
|
|
18
21
|
},
|
|
19
22
|
"files": [
|
|
20
|
-
"dist"
|
|
21
|
-
".pikku"
|
|
23
|
+
"dist"
|
|
22
24
|
],
|
|
23
25
|
"scripts": {
|
|
24
26
|
"build": "pikku all && tsc && cp -r .pikku dist/",
|
|
25
27
|
"pikku": "pikku all",
|
|
26
28
|
"ncu": "npx npm-check-updates",
|
|
27
29
|
"pretest": "pikku all",
|
|
28
|
-
"test": "tsc --noEmit"
|
|
30
|
+
"test": "tsc --noEmit",
|
|
31
|
+
"prepublishOnly": "yarn build"
|
|
29
32
|
},
|
|
30
33
|
"peerDependencies": {
|
|
31
34
|
"@pikku/core": "*",
|
|
@@ -34,10 +37,10 @@
|
|
|
34
37
|
"devDependencies": {
|
|
35
38
|
"@pikku/cli": "*",
|
|
36
39
|
"@pikku/core": "*",
|
|
37
|
-
"typescript": "^5.
|
|
40
|
+
"typescript": "^5.9.3",
|
|
38
41
|
"zod": "^4"
|
|
39
42
|
},
|
|
40
43
|
"dependencies": {
|
|
41
|
-
"dayjs": "^1.11.
|
|
44
|
+
"dayjs": "^1.11.19"
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Addon package types for pikkuAddonConfig and pikkuAddonServices
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { CreateConfig } from '@pikku/core'
|
|
9
|
-
import type { SingletonServices } from '../../types/application-types.d.js'
|
|
10
|
-
import type { Config } from '../../types/application-types.d.js'
|
|
11
|
-
import type { RequiredSingletonServices } from '../pikku-services.gen.js'
|
|
12
|
-
import { TypedSecretService } from '../secrets/pikku-secrets.gen.js'
|
|
13
|
-
import { TypedVariablesService } from '../variables/pikku-variables.gen.js'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Base services provided to addon package service factories.
|
|
20
|
-
* These are always available from the parent application.
|
|
21
|
-
*/
|
|
22
|
-
export type AddonBaseServices = {
|
|
23
|
-
logger: SingletonServices['logger']
|
|
24
|
-
variables: TypedVariablesService
|
|
25
|
-
secrets: TypedSecretService
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Creates a Pikku config factory for addon packages.
|
|
30
|
-
* Unlike pikkuConfig, this receives AddonBaseServices (logger, variables, secrets)
|
|
31
|
-
* from the parent application, so addon packages can read variables/secrets during config creation.
|
|
32
|
-
*/
|
|
33
|
-
export const pikkuAddonConfig = <ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
|
|
34
|
-
func: (services: ExistingServices) => Promise<Config>
|
|
35
|
-
): CreateConfig<Config> => {
|
|
36
|
-
return (async (_variables: any, existingServices?: Partial<SingletonServices>): Promise<Config> => {
|
|
37
|
-
const { secrets, variables, ...rest } = (existingServices ?? {}) as unknown as SingletonServices
|
|
38
|
-
return func({ ...rest, secrets: new TypedSecretService(secrets), variables: new TypedVariablesService(variables) } as ExistingServices)
|
|
39
|
-
}) as unknown as CreateConfig<Config>
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Creates a Pikku singleton services factory for addon packages.
|
|
44
|
-
* Unlike pikkuServices, this expects the parent application to provide
|
|
45
|
-
* logger, variables, and secrets - no fallbacks needed.
|
|
46
|
-
*
|
|
47
|
-
* @param func - Addon services factory function that receives config and base services
|
|
48
|
-
* @returns The singleton services factory function
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* export const createSingletonServices = pikkuAddonServices(async (
|
|
53
|
-
* config,
|
|
54
|
-
* { secrets }
|
|
55
|
-
* ) => {
|
|
56
|
-
* const creds = await secrets.getSecretJSON<GithubCredentials>('GITHUB_CREDENTIALS')
|
|
57
|
-
* const github = new GithubService(creds)
|
|
58
|
-
* return { github }
|
|
59
|
-
* })
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
export const pikkuAddonServices = <T extends Record<string, any>, ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
|
|
63
|
-
func: (config: Config, services: ExistingServices) => Promise<T>
|
|
64
|
-
) => {
|
|
65
|
-
return async (config: Config, existingServices?: Partial<SingletonServices>): Promise<RequiredSingletonServices> => {
|
|
66
|
-
const { logger, variables, secrets } = (existingServices ?? {}) as unknown as SingletonServices
|
|
67
|
-
const typedVariables = new TypedVariablesService(variables)
|
|
68
|
-
const typedSecrets = new TypedSecretService(secrets)
|
|
69
|
-
const result = await func(config, { ...existingServices, logger, variables: typedVariables, secrets: typedSecrets } as ExistingServices)
|
|
70
|
-
return {
|
|
71
|
-
config,
|
|
72
|
-
logger,
|
|
73
|
-
variables: typedVariables,
|
|
74
|
-
secrets: typedSecrets,
|
|
75
|
-
...result,
|
|
76
|
-
} as unknown as RequiredSingletonServices
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
import { pikkuState } from '@pikku/core/internal'
|
|
5
|
-
import { createSingletonServices as createSingletonServices } from '../../src/services.js'
|
|
6
|
-
|
|
7
|
-
pikkuState('@pikku/addon-graph', 'package', 'factories', {
|
|
8
|
-
createSingletonServices,
|
|
9
|
-
})
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
CoreAIAgent,
|
|
6
|
-
PikkuAIMiddlewareHooks,
|
|
7
|
-
} from '@pikku/core/ai-agent'
|
|
8
|
-
import {
|
|
9
|
-
agent as coreAgent,
|
|
10
|
-
agentStream as coreAgentStream,
|
|
11
|
-
agentResume as coreAgentResume,
|
|
12
|
-
agentApprove as coreAgentApprove,
|
|
13
|
-
} from '@pikku/core/ai-agent'
|
|
14
|
-
import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
|
|
15
|
-
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
16
|
-
import type { AIAgentMemoryConfig, AIAgentInput } from '@pikku/core/ai-agent'
|
|
17
|
-
import type { AgentMap } from './pikku-agent-map.gen.d.js'
|
|
18
|
-
|
|
19
|
-
type AIAgentConfig = Omit<CoreAIAgent<PikkuPermission, PikkuMiddleware>, 'tools' | 'agents' | 'memory'> & {
|
|
20
|
-
input?: StandardSchemaV1
|
|
21
|
-
output?: StandardSchemaV1
|
|
22
|
-
memory?: Omit<AIAgentMemoryConfig, 'workingMemory'> & { workingMemory?: StandardSchemaV1 }
|
|
23
|
-
tools?: object[]
|
|
24
|
-
agents?: AIAgentConfig[]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const pikkuAIAgent = (
|
|
28
|
-
agent: AIAgentConfig
|
|
29
|
-
) => {
|
|
30
|
-
return agent
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const pikkuAIMiddleware = <
|
|
34
|
-
State extends Record<string, unknown> = Record<string, unknown>,
|
|
35
|
-
RequiredServices extends Services = Services,
|
|
36
|
-
>(
|
|
37
|
-
hooks: PikkuAIMiddlewareHooks<State, RequiredServices>
|
|
38
|
-
): PikkuAIMiddlewareHooks<State, RequiredServices> => hooks
|
|
39
|
-
|
|
40
|
-
export const agent = <Name extends keyof AgentMap>(
|
|
41
|
-
agentName: Name
|
|
42
|
-
) => {
|
|
43
|
-
return coreAgent<AgentMap>(agentName as string & keyof AgentMap) as PikkuFunctionConfig<
|
|
44
|
-
AIAgentInput,
|
|
45
|
-
{ runId: string; result: AgentMap[Name]['output']; usage: { inputTokens: number; outputTokens: number } },
|
|
46
|
-
'session' | 'rpc'
|
|
47
|
-
>
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const agentStream = <Name extends keyof AgentMap>(
|
|
51
|
-
agentName?: Name
|
|
52
|
-
) => {
|
|
53
|
-
return coreAgentStream<AgentMap>(agentName as string & keyof AgentMap) as PikkuFunctionConfig<
|
|
54
|
-
{ agentName?: string; message: string; threadId: string; resourceId: string },
|
|
55
|
-
void,
|
|
56
|
-
'session' | 'rpc'
|
|
57
|
-
>
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const agentResume = () => {
|
|
61
|
-
return coreAgentResume() as PikkuFunctionConfig<
|
|
62
|
-
{ runId: string; toolCallId: string; approved: boolean },
|
|
63
|
-
void,
|
|
64
|
-
'session' | 'rpc'
|
|
65
|
-
>
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export const agentApprove = <Name extends keyof AgentMap>(
|
|
69
|
-
agentName: Name
|
|
70
|
-
) => {
|
|
71
|
-
return coreAgentApprove<AgentMap>(agentName as string & keyof AgentMap) as PikkuFunctionConfig<
|
|
72
|
-
{ runId: string; approvals: { toolCallId: string; approved: boolean }[] },
|
|
73
|
-
unknown,
|
|
74
|
-
'session' | 'rpc'
|
|
75
|
-
>
|
|
76
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
import { pikkuState } from '@pikku/core/internal'
|
|
5
|
-
import type { AIAgentMeta } from '@pikku/core/ai-agent'
|
|
6
|
-
import metaData from './pikku-agent-wirings-meta.gen.json' with { type: 'json' }
|
|
7
|
-
pikkuState('@pikku/addon-graph', 'agent', 'agentsMeta', metaData.agentsMeta as AIAgentMeta)
|