@pikku/addon-ollama 0.1.0
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/.pikku/addon/pikku-addon-types.gen.ts +78 -0
- package/.pikku/addon/pikku-package.gen.ts +9 -0
- package/.pikku/agent/pikku-agent-map.gen.d.ts +16 -0
- package/.pikku/agent/pikku-agent-types.gen.ts +76 -0
- package/.pikku/agent/pikku-agent-wirings-meta.gen.json +3 -0
- package/.pikku/agent/pikku-agent-wirings-meta.gen.ts +7 -0
- package/.pikku/agent/pikku-agent-wirings.gen.ts +3 -0
- package/.pikku/console/pikku-node-types.gen.ts +8 -0
- package/.pikku/console/pikku-nodes-meta.gen.json +57 -0
- package/.pikku/function/pikku-function-types.gen.ts +648 -0
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +106 -0
- package/.pikku/function/pikku-functions-meta.gen.json +74 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
- package/.pikku/function/pikku-functions.gen.ts +14 -0
- package/.pikku/pikku-bootstrap.gen.ts +15 -0
- package/.pikku/pikku-services.gen.ts +33 -0
- package/.pikku/pikku-types.gen.ts +21 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +188 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +192 -0
- package/.pikku/schemas/register.gen.ts +39 -0
- package/.pikku/schemas/schemas/OllamaEmbedInput.schema.json +1 -0
- package/.pikku/schemas/schemas/OllamaEmbedManyInput.schema.json +1 -0
- package/.pikku/schemas/schemas/OllamaEmbedManyOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/OllamaEmbedOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/OllamaGenerateObjectInput.schema.json +1 -0
- package/.pikku/schemas/schemas/OllamaGenerateObjectOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/OllamaGenerateTextInput.schema.json +1 -0
- package/.pikku/schemas/schemas/OllamaGenerateTextOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/VariableSchema_ollama_base_url.schema.json +1 -0
- package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
- package/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
- package/.pikku/secrets/pikku-secrets.gen.ts +21 -0
- package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
- package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
- package/.pikku/variables/pikku-variables-meta.gen.json +10 -0
- package/.pikku/variables/pikku-variables.gen.ts +23 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +34 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +158 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
- package/README.md +19 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +49 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.js +55 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +78 -0
- package/dist/.pikku/addon/pikku-package.gen.d.ts +2 -0
- package/dist/.pikku/addon/pikku-package.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/pikku-package.gen.js +9 -0
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -0
- package/dist/.pikku/addon/pikku-package.gen.ts +9 -0
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +16 -0
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +47 -0
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -0
- package/dist/.pikku/agent/pikku-agent-types.gen.js +18 -0
- package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -0
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +76 -0
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +2 -0
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +1 -0
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +7 -0
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +1 -0
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +3 -0
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +7 -0
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +5 -0
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +1 -0
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +5 -0
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +1 -0
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +3 -0
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +7 -0
- package/dist/.pikku/console/pikku-node-types.gen.d.ts.map +1 -0
- package/dist/.pikku/console/pikku-node-types.gen.js +2 -0
- package/dist/.pikku/console/pikku-node-types.gen.js.map +1 -0
- package/dist/.pikku/console/pikku-node-types.gen.ts +8 -0
- package/dist/.pikku/console/pikku-nodes-meta.gen.json +57 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +477 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -0
- package/dist/.pikku/function/pikku-function-types.gen.js +298 -0
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -0
- package/dist/.pikku/function/pikku-function-types.gen.ts +648 -0
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +106 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.d.ts +2 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.d.ts.map +1 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js +7 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js.map +1 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.json +74 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +7 -0
- package/dist/.pikku/function/pikku-functions.gen.d.ts +2 -0
- package/dist/.pikku/function/pikku-functions.gen.d.ts.map +1 -0
- package/dist/.pikku/function/pikku-functions.gen.js +14 -0
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -0
- package/dist/.pikku/function/pikku-functions.gen.ts +14 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +7 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-bootstrap.gen.js +17 -0
- package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -0
- package/dist/.pikku/pikku-bootstrap.gen.ts +15 -0
- package/dist/.pikku/pikku-services.gen.d.ts +26 -0
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-services.gen.js +21 -0
- package/dist/.pikku/pikku-services.gen.js.map +1 -0
- package/dist/.pikku/pikku-services.gen.ts +33 -0
- package/dist/.pikku/pikku-types.gen.d.ts +12 -0
- package/dist/.pikku/pikku-types.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-types.gen.js +17 -0
- package/dist/.pikku/pikku-types.gen.js.map +1 -0
- package/dist/.pikku/pikku-types.gen.ts +21 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +188 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +192 -0
- package/dist/.pikku/schemas/register.gen.d.ts +2 -0
- package/dist/.pikku/schemas/register.gen.d.ts.map +1 -0
- package/dist/.pikku/schemas/register.gen.js +23 -0
- package/dist/.pikku/schemas/register.gen.js.map +1 -0
- package/dist/.pikku/schemas/register.gen.ts +39 -0
- package/dist/.pikku/schemas/schemas/OllamaEmbedInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/OllamaEmbedManyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/OllamaEmbedManyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/OllamaEmbedOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/OllamaGenerateObjectInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/OllamaGenerateObjectOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/OllamaGenerateTextInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/OllamaGenerateTextOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/VariableSchema_ollama_base_url.schema.json +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +6 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts.map +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +5 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.js.map +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
- package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +12 -0
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts.map +1 -0
- package/dist/.pikku/secrets/pikku-secrets.gen.js +11 -0
- package/dist/.pikku/secrets/pikku-secrets.gen.js.map +1 -0
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +21 -0
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +114 -0
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts.map +1 -0
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +34 -0
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js.map +1 -0
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +6 -0
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts.map +1 -0
- package/dist/.pikku/variables/pikku-variable-types.gen.js +5 -0
- package/dist/.pikku/variables/pikku-variable-types.gen.js.map +1 -0
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +5 -0
- package/dist/.pikku/variables/pikku-variables-meta.gen.json +10 -0
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +15 -0
- package/dist/.pikku/variables/pikku-variables.gen.d.ts.map +1 -0
- package/dist/.pikku/variables/pikku-variables.gen.js +13 -0
- package/dist/.pikku/variables/pikku-variables.gen.js.map +1 -0
- package/dist/.pikku/variables/pikku-variables.gen.ts +23 -0
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +34 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +81 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +31 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +158 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts +2 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts.map +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +7 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js.map +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +5 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts.map +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +5 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js.map +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
- package/dist/src/functions/embeddings/embed-many.function.d.ts +37 -0
- package/dist/src/functions/embeddings/embed-many.function.d.ts.map +1 -0
- package/dist/src/functions/embeddings/embed-many.function.js +31 -0
- package/dist/src/functions/embeddings/embed-many.function.js.map +1 -0
- package/dist/src/functions/embeddings/embed.function.d.ts +37 -0
- package/dist/src/functions/embeddings/embed.function.d.ts.map +1 -0
- package/dist/src/functions/embeddings/embed.function.js +31 -0
- package/dist/src/functions/embeddings/embed.function.js.map +1 -0
- package/dist/src/functions/text/generate-object.function.d.ts +101 -0
- package/dist/src/functions/text/generate-object.function.d.ts.map +1 -0
- package/dist/src/functions/text/generate-object.function.js +56 -0
- package/dist/src/functions/text/generate-object.function.js.map +1 -0
- package/dist/src/functions/text/generate.function.d.ts +89 -0
- package/dist/src/functions/text/generate.function.d.ts.map +1 -0
- package/dist/src/functions/text/generate.function.js +51 -0
- package/dist/src/functions/text/generate.function.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/ollama.variable.d.ts +3 -0
- package/dist/src/ollama.variable.d.ts.map +1 -0
- package/dist/src/ollama.variable.js +11 -0
- package/dist/src/ollama.variable.js.map +1 -0
- package/dist/src/services.d.ts +2 -0
- package/dist/src/services.d.ts.map +1 -0
- package/dist/src/services.js +11 -0
- package/dist/src/services.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* This provides the structure needed for typescript to be aware of RPCs and their return types
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export type OllamaGenerateTextInput = {
|
|
13
|
+
/** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
|
|
14
|
+
model: string;
|
|
15
|
+
/** The prompt to generate text from */
|
|
16
|
+
prompt?: string | undefined;
|
|
17
|
+
/** A list of messages comprising the conversation so far */
|
|
18
|
+
messages?: {
|
|
19
|
+
/** The role of the message author */
|
|
20
|
+
role: "system" | "user" | "assistant";
|
|
21
|
+
/** The contents of the message */
|
|
22
|
+
content: string;
|
|
23
|
+
}[] | undefined;
|
|
24
|
+
/** System message to set the behavior of the model */
|
|
25
|
+
system?: string | undefined;
|
|
26
|
+
/** Maximum number of tokens to generate */
|
|
27
|
+
maxTokens?: number | undefined;
|
|
28
|
+
/** Sampling temperature between 0 and 2 */
|
|
29
|
+
temperature?: number | undefined;
|
|
30
|
+
/** Nucleus sampling parameter */
|
|
31
|
+
topP?: number | undefined;
|
|
32
|
+
/** Random seed for reproducible results */
|
|
33
|
+
seed?: number | undefined;
|
|
34
|
+
}
|
|
35
|
+
export type OllamaGenerateTextOutput = {
|
|
36
|
+
/** The generated text */
|
|
37
|
+
text: string;
|
|
38
|
+
/** The reason the model stopped generating */
|
|
39
|
+
finishReason: string;
|
|
40
|
+
/** Token usage statistics */
|
|
41
|
+
usage: {
|
|
42
|
+
/** Number of tokens in the prompt */
|
|
43
|
+
promptTokens: number;
|
|
44
|
+
/** Number of tokens in the completion */
|
|
45
|
+
completionTokens: number;
|
|
46
|
+
/** Total number of tokens used */
|
|
47
|
+
totalTokens: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export type OllamaGenerateObjectInput = {
|
|
51
|
+
/** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
|
|
52
|
+
model: string;
|
|
53
|
+
/** The prompt to generate a structured object from */
|
|
54
|
+
prompt?: string | undefined;
|
|
55
|
+
/** A list of messages comprising the conversation so far */
|
|
56
|
+
messages?: {
|
|
57
|
+
/** The role of the message author */
|
|
58
|
+
role: "system" | "user" | "assistant";
|
|
59
|
+
/** The contents of the message */
|
|
60
|
+
content: string;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
/** System message to set the behavior of the model */
|
|
63
|
+
system?: string | undefined;
|
|
64
|
+
/** JSON Schema describing the expected output object */
|
|
65
|
+
schema: {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
};
|
|
68
|
+
/** Optional name for the schema */
|
|
69
|
+
schemaName?: string | undefined;
|
|
70
|
+
/** Optional description of what the schema represents */
|
|
71
|
+
schemaDescription?: string | undefined;
|
|
72
|
+
/** Mode for object generation. Use "json" for models that do not support tools. */
|
|
73
|
+
mode?: ("auto" | "tool" | "json") | undefined;
|
|
74
|
+
/** Maximum number of tokens to generate */
|
|
75
|
+
maxTokens?: number | undefined;
|
|
76
|
+
/** Sampling temperature between 0 and 2 */
|
|
77
|
+
temperature?: number | undefined;
|
|
78
|
+
}
|
|
79
|
+
export type OllamaGenerateObjectOutput = {
|
|
80
|
+
/** The generated structured object */
|
|
81
|
+
object: any;
|
|
82
|
+
/** The reason the model stopped generating */
|
|
83
|
+
finishReason: string;
|
|
84
|
+
/** Token usage statistics */
|
|
85
|
+
usage: {
|
|
86
|
+
/** Number of tokens in the prompt */
|
|
87
|
+
promptTokens: number;
|
|
88
|
+
/** Number of tokens in the completion */
|
|
89
|
+
completionTokens: number;
|
|
90
|
+
/** Total number of tokens used */
|
|
91
|
+
totalTokens: number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export type OllamaEmbedInput = {
|
|
95
|
+
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
96
|
+
model: string;
|
|
97
|
+
/** The text to embed */
|
|
98
|
+
value: string;
|
|
99
|
+
}
|
|
100
|
+
export type OllamaEmbedOutput = {
|
|
101
|
+
/** The embedding vector */
|
|
102
|
+
embedding: number[];
|
|
103
|
+
/** Token usage statistics */
|
|
104
|
+
usage: {
|
|
105
|
+
/** Number of tokens used */
|
|
106
|
+
tokens: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export type OllamaEmbedManyInput = {
|
|
110
|
+
/** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
|
|
111
|
+
model: string;
|
|
112
|
+
/** The texts to embed */
|
|
113
|
+
values: string[];
|
|
114
|
+
}
|
|
115
|
+
export type OllamaEmbedManyOutput = {
|
|
116
|
+
/** The embedding vectors */
|
|
117
|
+
embeddings: number[][];
|
|
118
|
+
/** Token usage statistics */
|
|
119
|
+
usage: {
|
|
120
|
+
/** Number of tokens used */
|
|
121
|
+
tokens: number;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export type VariableSchema_ollama_base_url = string
|
|
125
|
+
|
|
126
|
+
interface RPCHandler<I, O> {
|
|
127
|
+
input: I;
|
|
128
|
+
output: O;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type RPCMap = {
|
|
132
|
+
readonly 'ollamaGenerateText': RPCHandler<OllamaGenerateTextInput, OllamaGenerateTextOutput>,
|
|
133
|
+
readonly 'ollamaGenerateObject': RPCHandler<OllamaGenerateObjectInput, OllamaGenerateObjectOutput>,
|
|
134
|
+
readonly 'ollamaEmbed': RPCHandler<OllamaEmbedInput, OllamaEmbedOutput>,
|
|
135
|
+
readonly 'ollamaEmbedMany': RPCHandler<OllamaEmbedManyInput, OllamaEmbedManyOutput>,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
// No addon packages, use RPCMap directly
|
|
141
|
+
export type FlattenedRPCMap = RPCMap
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
export type RPCInvoke = <Name extends keyof FlattenedRPCMap>(
|
|
145
|
+
name: Name,
|
|
146
|
+
data: FlattenedRPCMap[Name]['input']
|
|
147
|
+
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
148
|
+
|
|
149
|
+
export type RPCRemote = <Name extends keyof FlattenedRPCMap>(
|
|
150
|
+
name: Name,
|
|
151
|
+
data: FlattenedRPCMap[Name]['input']
|
|
152
|
+
) => Promise<FlattenedRPCMap[Name]['output']>
|
|
153
|
+
|
|
154
|
+
import type { WorkflowMap } from '../workflow/pikku-workflow-map.gen.d.js'
|
|
155
|
+
|
|
156
|
+
import type { AgentMap } from '../agent/pikku-agent-map.gen.d.js'
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
type FlattenedAgentMap = AgentMap
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
import type { PikkuRPC } from '@pikku/core/rpc'
|
|
163
|
+
|
|
164
|
+
interface AIAgentInput {
|
|
165
|
+
message: string
|
|
166
|
+
threadId: string
|
|
167
|
+
resourceId: string
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type TypedStartWorkflow = <Name extends keyof WorkflowMap>(
|
|
171
|
+
name: Name,
|
|
172
|
+
input: WorkflowMap[Name]['input'],
|
|
173
|
+
options?: { startNode?: string }
|
|
174
|
+
) => Promise<{ runId: string }>
|
|
175
|
+
|
|
176
|
+
type TypedAgentRun = [keyof FlattenedAgentMap] extends [never]
|
|
177
|
+
? (name: string, input: AIAgentInput) => Promise<any>
|
|
178
|
+
: <Name extends keyof FlattenedAgentMap>(
|
|
179
|
+
name: Name,
|
|
180
|
+
input: AIAgentInput
|
|
181
|
+
) => Promise<{ runId: string; result: FlattenedAgentMap[Name]['output']; usage: { inputTokens: number; outputTokens: number } }>
|
|
182
|
+
|
|
183
|
+
type TypedAgentStream = [keyof FlattenedAgentMap] extends [never]
|
|
184
|
+
? (name: string, input: AIAgentInput, options?: { requiresToolApproval?: 'all' | 'explicit' | false }) => Promise<void>
|
|
185
|
+
: <Name extends keyof FlattenedAgentMap>(
|
|
186
|
+
name: Name,
|
|
187
|
+
input: AIAgentInput,
|
|
188
|
+
options?: { requiresToolApproval?: 'all' | 'explicit' | false }
|
|
189
|
+
) => Promise<void>
|
|
190
|
+
|
|
191
|
+
export type TypedPikkuRPC = PikkuRPC<RPCInvoke, RPCRemote, TypedStartWorkflow, TypedAgentRun, TypedAgentStream>
|
|
192
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/schemas/register.gen.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
import { addSchema } from '@pikku/core/schema';
|
|
5
|
+
import * as OllamaGenerateTextInput from './schemas/OllamaGenerateTextInput.schema.json' with { type: 'json' };
|
|
6
|
+
addSchema('OllamaGenerateTextInput', OllamaGenerateTextInput, '@pikku/addon-ollama');
|
|
7
|
+
import * as OllamaGenerateTextOutput from './schemas/OllamaGenerateTextOutput.schema.json' with { type: 'json' };
|
|
8
|
+
addSchema('OllamaGenerateTextOutput', OllamaGenerateTextOutput, '@pikku/addon-ollama');
|
|
9
|
+
import * as OllamaGenerateObjectInput from './schemas/OllamaGenerateObjectInput.schema.json' with { type: 'json' };
|
|
10
|
+
addSchema('OllamaGenerateObjectInput', OllamaGenerateObjectInput, '@pikku/addon-ollama');
|
|
11
|
+
import * as OllamaGenerateObjectOutput from './schemas/OllamaGenerateObjectOutput.schema.json' with { type: 'json' };
|
|
12
|
+
addSchema('OllamaGenerateObjectOutput', OllamaGenerateObjectOutput, '@pikku/addon-ollama');
|
|
13
|
+
import * as OllamaEmbedInput from './schemas/OllamaEmbedInput.schema.json' with { type: 'json' };
|
|
14
|
+
addSchema('OllamaEmbedInput', OllamaEmbedInput, '@pikku/addon-ollama');
|
|
15
|
+
import * as OllamaEmbedOutput from './schemas/OllamaEmbedOutput.schema.json' with { type: 'json' };
|
|
16
|
+
addSchema('OllamaEmbedOutput', OllamaEmbedOutput, '@pikku/addon-ollama');
|
|
17
|
+
import * as OllamaEmbedManyInput from './schemas/OllamaEmbedManyInput.schema.json' with { type: 'json' };
|
|
18
|
+
addSchema('OllamaEmbedManyInput', OllamaEmbedManyInput, '@pikku/addon-ollama');
|
|
19
|
+
import * as OllamaEmbedManyOutput from './schemas/OllamaEmbedManyOutput.schema.json' with { type: 'json' };
|
|
20
|
+
addSchema('OllamaEmbedManyOutput', OllamaEmbedManyOutput, '@pikku/addon-ollama');
|
|
21
|
+
import * as VariableSchema_ollama_base_url from './schemas/VariableSchema_ollama_base_url.schema.json' with { type: 'json' };
|
|
22
|
+
addSchema('VariableSchema_ollama_base_url', VariableSchema_ollama_base_url, '@pikku/addon-ollama');
|
|
23
|
+
//# sourceMappingURL=register.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.gen.js","sourceRoot":"","sources":["../../../.pikku/schemas/register.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,KAAK,uBAAuB,MAAM,+CAA+C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9G,SAAS,CAAC,yBAAyB,EAAE,uBAAuB,EAAE,qBAAqB,CAAC,CAAA;AAGpF,OAAO,KAAK,wBAAwB,MAAM,gDAAgD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAChH,SAAS,CAAC,0BAA0B,EAAE,wBAAwB,EAAE,qBAAqB,CAAC,CAAA;AAGtF,OAAO,KAAK,yBAAyB,MAAM,iDAAiD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAClH,SAAS,CAAC,2BAA2B,EAAE,yBAAyB,EAAE,qBAAqB,CAAC,CAAA;AAGxF,OAAO,KAAK,0BAA0B,MAAM,kDAAkD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACpH,SAAS,CAAC,4BAA4B,EAAE,0BAA0B,EAAE,qBAAqB,CAAC,CAAA;AAG1F,OAAO,KAAK,gBAAgB,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAChG,SAAS,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,CAAC,CAAA;AAGtE,OAAO,KAAK,iBAAiB,MAAM,yCAAyC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAClG,SAAS,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,CAAC,CAAA;AAGxE,OAAO,KAAK,oBAAoB,MAAM,4CAA4C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACxG,SAAS,CAAC,sBAAsB,EAAE,oBAAoB,EAAE,qBAAqB,CAAC,CAAA;AAG9E,OAAO,KAAK,qBAAqB,MAAM,6CAA6C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC1G,SAAS,CAAC,uBAAuB,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAA;AAGhF,OAAO,KAAK,8BAA8B,MAAM,sDAAsD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC5H,SAAS,CAAC,gCAAgC,EAAE,8BAA8B,EAAE,qBAAqB,CAAC,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
import { addSchema } from '@pikku/core/schema'
|
|
5
|
+
|
|
6
|
+
import * as OllamaGenerateTextInput from './schemas/OllamaGenerateTextInput.schema.json' with { type: 'json' }
|
|
7
|
+
addSchema('OllamaGenerateTextInput', OllamaGenerateTextInput, '@pikku/addon-ollama')
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
import * as OllamaGenerateTextOutput from './schemas/OllamaGenerateTextOutput.schema.json' with { type: 'json' }
|
|
11
|
+
addSchema('OllamaGenerateTextOutput', OllamaGenerateTextOutput, '@pikku/addon-ollama')
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import * as OllamaGenerateObjectInput from './schemas/OllamaGenerateObjectInput.schema.json' with { type: 'json' }
|
|
15
|
+
addSchema('OllamaGenerateObjectInput', OllamaGenerateObjectInput, '@pikku/addon-ollama')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
import * as OllamaGenerateObjectOutput from './schemas/OllamaGenerateObjectOutput.schema.json' with { type: 'json' }
|
|
19
|
+
addSchema('OllamaGenerateObjectOutput', OllamaGenerateObjectOutput, '@pikku/addon-ollama')
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
import * as OllamaEmbedInput from './schemas/OllamaEmbedInput.schema.json' with { type: 'json' }
|
|
23
|
+
addSchema('OllamaEmbedInput', OllamaEmbedInput, '@pikku/addon-ollama')
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
import * as OllamaEmbedOutput from './schemas/OllamaEmbedOutput.schema.json' with { type: 'json' }
|
|
27
|
+
addSchema('OllamaEmbedOutput', OllamaEmbedOutput, '@pikku/addon-ollama')
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
import * as OllamaEmbedManyInput from './schemas/OllamaEmbedManyInput.schema.json' with { type: 'json' }
|
|
31
|
+
addSchema('OllamaEmbedManyInput', OllamaEmbedManyInput, '@pikku/addon-ollama')
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
import * as OllamaEmbedManyOutput from './schemas/OllamaEmbedManyOutput.schema.json' with { type: 'json' }
|
|
35
|
+
addSchema('OllamaEmbedManyOutput', OllamaEmbedManyOutput, '@pikku/addon-ollama')
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
import * as VariableSchema_ollama_base_url from './schemas/VariableSchema_ollama_base_url.schema.json' with { type: 'json' }
|
|
39
|
+
addSchema('VariableSchema_ollama_base_url', VariableSchema_ollama_base_url, '@pikku/addon-ollama')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"model":{"type":"string","description":"The Ollama embedding model to use (e.g. \"nomic-embed-text\", \"mxbai-embed-large\")"},"value":{"type":"string","description":"The text to embed"}},"required":["model","value"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"model":{"type":"string","description":"The Ollama embedding model to use (e.g. \"nomic-embed-text\", \"mxbai-embed-large\")"},"values":{"type":"array","items":{"type":"string"},"description":"The texts to embed"}},"required":["model","values"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"embeddings":{"type":"array","items":{"type":"array","items":{"type":"number"}},"description":"The embedding vectors"},"usage":{"type":"object","properties":{"tokens":{"type":"number","description":"Number of tokens used"}},"required":["tokens"],"additionalProperties":false,"description":"Token usage statistics"}},"required":["embeddings","usage"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"embedding":{"type":"array","items":{"type":"number"},"description":"The embedding vector"},"usage":{"type":"object","properties":{"tokens":{"type":"number","description":"Number of tokens used"}},"required":["tokens"],"additionalProperties":false,"description":"Token usage statistics"}},"required":["embedding","usage"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"model":{"type":"string","description":"The Ollama model to use (e.g. \"llama3.2\", \"phi3:mini\")"},"prompt":{"description":"The prompt to generate a structured object from","type":"string"},"messages":{"description":"A list of messages comprising the conversation so far","type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"description":"The role of the message author"},"content":{"type":"string","description":"The contents of the message"}},"required":["role","content"],"additionalProperties":false}},"system":{"description":"System message to set the behavior of the model","type":"string"},"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"JSON Schema describing the expected output object"},"schemaName":{"description":"Optional name for the schema","type":"string"},"schemaDescription":{"description":"Optional description of what the schema represents","type":"string"},"mode":{"description":"Mode for object generation. Use \"json\" for models that do not support tools.","type":"string","enum":["auto","tool","json"]},"maxTokens":{"description":"Maximum number of tokens to generate","type":"number"},"temperature":{"description":"Sampling temperature between 0 and 2","type":"number","minimum":0,"maximum":2}},"required":["model","schema"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"object":{"description":"The generated structured object"},"finishReason":{"type":"string","description":"The reason the model stopped generating"},"usage":{"type":"object","properties":{"promptTokens":{"type":"number","description":"Number of tokens in the prompt"},"completionTokens":{"type":"number","description":"Number of tokens in the completion"},"totalTokens":{"type":"number","description":"Total number of tokens used"}},"required":["promptTokens","completionTokens","totalTokens"],"additionalProperties":false,"description":"Token usage statistics"}},"required":["object","finishReason","usage"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"model":{"type":"string","description":"The Ollama model to use (e.g. \"llama3.2\", \"phi3:mini\")"},"prompt":{"description":"The prompt to generate text from","type":"string"},"messages":{"description":"A list of messages comprising the conversation so far","type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"description":"The role of the message author"},"content":{"type":"string","description":"The contents of the message"}},"required":["role","content"],"additionalProperties":false}},"system":{"description":"System message to set the behavior of the model","type":"string"},"maxTokens":{"description":"Maximum number of tokens to generate","type":"number"},"temperature":{"description":"Sampling temperature between 0 and 2","type":"number","minimum":0,"maximum":2},"topP":{"description":"Nucleus sampling parameter","type":"number"},"seed":{"description":"Random seed for reproducible results","type":"number"}},"required":["model"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","description":"The generated text"},"finishReason":{"type":"string","description":"The reason the model stopped generating"},"usage":{"type":"object","properties":{"promptTokens":{"type":"number","description":"Number of tokens in the prompt"},"completionTokens":{"type":"number","description":"Number of tokens in the completion"},"totalTokens":{"type":"number","description":"Total number of tokens used"}},"required":["promptTokens","completionTokens","totalTokens"],"additionalProperties":false,"description":"Token usage statistics"}},"required":["text","finishReason","usage"],"additionalProperties":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","default":"http://localhost:11434/v1","description":"Base URL for the Ollama API","type":"string"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-secret-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secret-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-secret-types.gen.js","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secret-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
|
|
5
|
+
import type { SecretService } from '@pikku/core/services';
|
|
6
|
+
export interface CredentialsMap {
|
|
7
|
+
}
|
|
8
|
+
export type SecretId = keyof CredentialsMap;
|
|
9
|
+
export declare class TypedSecretService extends CoreTypedSecretService<CredentialsMap> {
|
|
10
|
+
constructor(secrets: SecretService);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=pikku-secrets.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-secrets.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secrets.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAuB,MAAM,sBAAsB,CAAA;AACxG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,MAAM,WAAW,cAAc;CAE9B;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAA;AAM3C,qBAAa,kBAAmB,SAAQ,sBAAsB,CAAC,cAAc,CAAC;gBAChE,OAAO,EAAE,aAAa;CAGnC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
|
|
5
|
+
const CREDENTIALS_META = {};
|
|
6
|
+
export class TypedSecretService extends CoreTypedSecretService {
|
|
7
|
+
constructor(secrets) {
|
|
8
|
+
super(secrets, CREDENTIALS_META);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=pikku-secrets.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-secrets.gen.js","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secrets.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAuB,MAAM,sBAAsB,CAAA;AASxG,MAAM,gBAAgB,GAAmC,EAExD,CAAA;AAED,MAAM,OAAO,kBAAmB,SAAQ,sBAAsC;IAC5E,YAAY,OAAsB;QAChC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
import { TypedSecretService as CoreTypedSecretService, type CredentialMeta } from '@pikku/core/services'
|
|
5
|
+
import type { SecretService } from '@pikku/core/services'
|
|
6
|
+
|
|
7
|
+
export interface CredentialsMap {
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type SecretId = keyof CredentialsMap
|
|
12
|
+
|
|
13
|
+
const CREDENTIALS_META: Record<string, CredentialMeta> = {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class TypedSecretService extends CoreTypedSecretService<CredentialsMap> {
|
|
18
|
+
constructor(secrets: SecretService) {
|
|
19
|
+
super(secrets, CREDENTIALS_META)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Trigger-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { CorePikkuTriggerFunction, CorePikkuTriggerFunctionConfig, CoreTrigger } from '@pikku/core/trigger';
|
|
8
|
+
import type { CoreNodeConfig } from '@pikku/core/node';
|
|
9
|
+
import type { SingletonServices } from '../../types/application-types.d.js';
|
|
10
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
11
|
+
/**
|
|
12
|
+
* A trigger function that sets up a subscription and returns a teardown function.
|
|
13
|
+
* The trigger is fired via wire.trigger.invoke(data).
|
|
14
|
+
*
|
|
15
|
+
* @template TInput - Input type (configuration passed when wired)
|
|
16
|
+
* @template TOutput - Output type produced when trigger fires
|
|
17
|
+
*/
|
|
18
|
+
export type PikkuTriggerFunction<TInput = unknown, TOutput = unknown> = CorePikkuTriggerFunction<TInput, TOutput, SingletonServices>;
|
|
19
|
+
/**
|
|
20
|
+
* Configuration object for creating a trigger function with metadata
|
|
21
|
+
*/
|
|
22
|
+
export type PikkuTriggerFunctionConfig<TInput = unknown, TOutput = unknown, InputSchema extends StandardSchemaV1 | undefined = undefined, OutputSchema extends StandardSchemaV1 | undefined = undefined> = CorePikkuTriggerFunctionConfig<TInput, TOutput, SingletonServices, InputSchema, OutputSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Helper type to infer the output type from a Standard Schema
|
|
25
|
+
*/
|
|
26
|
+
type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never;
|
|
27
|
+
/**
|
|
28
|
+
* Configuration object for trigger functions with Zod schema validation.
|
|
29
|
+
* Use this when you want to define input/output schemas using Zod.
|
|
30
|
+
* Types are automatically inferred from the schemas.
|
|
31
|
+
*/
|
|
32
|
+
export type PikkuTriggerFunctionConfigWithSchema<InputSchema extends StandardSchemaV1, OutputSchema extends StandardSchemaV1 | undefined = undefined> = {
|
|
33
|
+
title?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
tags?: string[];
|
|
36
|
+
func: PikkuTriggerFunction<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>;
|
|
37
|
+
input: InputSchema;
|
|
38
|
+
output?: OutputSchema;
|
|
39
|
+
node?: CoreNodeConfig;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Type definition for trigger wirings.
|
|
43
|
+
* Declares a trigger name and its target pikku function.
|
|
44
|
+
*/
|
|
45
|
+
export type TriggerWiring = CoreTrigger;
|
|
46
|
+
/**
|
|
47
|
+
* A trigger source with the subscription function, using project-specific services.
|
|
48
|
+
*
|
|
49
|
+
* @template TInput - Input type passed to the trigger function
|
|
50
|
+
* @template TOutput - Output type produced when trigger fires
|
|
51
|
+
*/
|
|
52
|
+
export type TriggerSource<TInput = unknown, TOutput = unknown> = {
|
|
53
|
+
name: string;
|
|
54
|
+
func: PikkuTriggerFunctionConfig<TInput, TOutput>;
|
|
55
|
+
} & (unknown extends TInput ? {
|
|
56
|
+
input?: TInput;
|
|
57
|
+
} : {
|
|
58
|
+
input: TInput;
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Creates a trigger function configuration.
|
|
62
|
+
* Use this to define trigger functions that set up subscriptions.
|
|
63
|
+
*
|
|
64
|
+
* @param triggerOrConfig - Function definition or configuration object
|
|
65
|
+
* @returns The normalized configuration object
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* export const redisSubscribeTrigger = pikkuTriggerFunc<
|
|
70
|
+
* { channel: string },
|
|
71
|
+
* { message: string }
|
|
72
|
+
* >(async ({ redis }, { channel }, { trigger }) => {
|
|
73
|
+
* const subscriber = redis.duplicate()
|
|
74
|
+
* await subscriber.subscribe(channel, (msg) => {
|
|
75
|
+
* trigger.invoke({ message: msg })
|
|
76
|
+
* })
|
|
77
|
+
* return () => subscriber.unsubscribe()
|
|
78
|
+
* })
|
|
79
|
+
*
|
|
80
|
+
* export const redisSubscribeTrigger = pikkuTriggerFunc({
|
|
81
|
+
* title: 'Redis Subscribe Trigger',
|
|
82
|
+
* description: 'Listens to Redis pub/sub channel',
|
|
83
|
+
* input: z.object({ channel: z.string() }),
|
|
84
|
+
* output: z.object({ message: z.string() }),
|
|
85
|
+
* func: async ({ redis }, { channel }, { trigger }) => {
|
|
86
|
+
* const subscriber = redis.duplicate()
|
|
87
|
+
* await subscriber.subscribe(channel, (msg) => {
|
|
88
|
+
* trigger.invoke({ message: msg })
|
|
89
|
+
* })
|
|
90
|
+
* return () => subscriber.unsubscribe()
|
|
91
|
+
* }
|
|
92
|
+
* })
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function pikkuTriggerFunc<InputSchema extends StandardSchemaV1, OutputSchema extends StandardSchemaV1 | undefined = undefined>(config: PikkuTriggerFunctionConfigWithSchema<InputSchema, OutputSchema>): PikkuTriggerFunctionConfig<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, InputSchema, OutputSchema>;
|
|
96
|
+
export declare function pikkuTriggerFunc<TInput, TOutput = unknown>(triggerOrConfig: PikkuTriggerFunction<TInput, TOutput> | PikkuTriggerFunctionConfig<TInput, TOutput>): PikkuTriggerFunctionConfig<TInput, TOutput>;
|
|
97
|
+
/**
|
|
98
|
+
* Registers a trigger with the Pikku framework.
|
|
99
|
+
* Declares a trigger name and its target pikku function.
|
|
100
|
+
* Runs everywhere — inspector extracts at build time.
|
|
101
|
+
*
|
|
102
|
+
* @param trigger - Trigger definition with name and function config
|
|
103
|
+
*/
|
|
104
|
+
export declare const wireTrigger: (trigger: TriggerWiring) => void;
|
|
105
|
+
/**
|
|
106
|
+
* Registers a trigger source with the Pikku framework.
|
|
107
|
+
* Provides the subscription function and input data.
|
|
108
|
+
* Only imported in the trigger worker process.
|
|
109
|
+
*
|
|
110
|
+
* @param source - Trigger source with name, func, and input
|
|
111
|
+
*/
|
|
112
|
+
export declare const wireTriggerSource: <TInput = unknown, TOutput = unknown>(source: TriggerSource<TInput, TOutput>) => void;
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=pikku-trigger-types.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-trigger-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/trigger/pikku-trigger-types.gen.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Trigger-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { wireTrigger as wireTriggerCore, wireTriggerSource as wireTriggerSourceCore } from '@pikku/core/trigger';
|
|
8
|
+
export function pikkuTriggerFunc(triggerOrConfig) {
|
|
9
|
+
if (typeof triggerOrConfig === 'function') {
|
|
10
|
+
return { func: triggerOrConfig };
|
|
11
|
+
}
|
|
12
|
+
return triggerOrConfig;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Registers a trigger with the Pikku framework.
|
|
16
|
+
* Declares a trigger name and its target pikku function.
|
|
17
|
+
* Runs everywhere — inspector extracts at build time.
|
|
18
|
+
*
|
|
19
|
+
* @param trigger - Trigger definition with name and function config
|
|
20
|
+
*/
|
|
21
|
+
export const wireTrigger = (trigger) => {
|
|
22
|
+
wireTriggerCore(trigger);
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Registers a trigger source with the Pikku framework.
|
|
26
|
+
* Provides the subscription function and input data.
|
|
27
|
+
* Only imported in the trigger worker process.
|
|
28
|
+
*
|
|
29
|
+
* @param source - Trigger source with name, func, and input
|
|
30
|
+
*/
|
|
31
|
+
export const wireTriggerSource = (source) => {
|
|
32
|
+
wireTriggerSourceCore(source);
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=pikku-trigger-types.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pikku-trigger-types.gen.js","sourceRoot":"","sources":["../../../.pikku/trigger/pikku-trigger-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAAyE,WAAW,IAAI,eAAe,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAyHvL,MAAM,UAAU,gBAAgB,CAAC,eAAoB;IACnD,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,CAAA;IAClC,CAAC;IACD,OAAO,eAAe,CAAA;AACxB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,OAAsB,EACtB,EAAE;IACF,eAAe,CAAC,OAAc,CAAC,CAAA;AACjC,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAAsC,EACtC,EAAE;IACF,qBAAqB,CAAC,MAAa,CAAC,CAAA;AACtC,CAAC,CAAA"}
|