@pikku/addon-ollama 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/.pikku/addon/pikku-addon-types.gen.ts +105 -0
  2. package/.pikku/addon/pikku-package.gen.ts +11 -0
  3. package/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
  4. package/.pikku/agent/pikku-agent-types.gen.ts +82 -0
  5. package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  6. package/.pikku/console/pikku-addon-meta.gen.json +58 -0
  7. package/.pikku/console/pikku-node-types.gen.ts +8 -0
  8. package/.pikku/function/pikku-function-types.gen.ts +754 -0
  9. package/.pikku/function/pikku-functions-meta-verbose.gen.json +118 -0
  10. package/.pikku/function/pikku-functions-meta.gen.json +78 -0
  11. package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
  12. package/.pikku/function/pikku-functions.gen.ts +14 -0
  13. package/.pikku/http/pikku-http-types.gen.ts +147 -0
  14. package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  15. package/.pikku/pikku-bootstrap.gen.ts +8 -0
  16. package/.pikku/pikku-meta-service.gen.ts +10 -0
  17. package/.pikku/pikku-services.gen.ts +45 -0
  18. package/.pikku/pikku-types.gen.ts +21 -0
  19. package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  20. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +207 -0
  21. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +211 -0
  22. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +6 -0
  23. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  24. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  25. package/.pikku/schemas/register.gen.ts +39 -0
  26. package/.pikku/schemas/schemas/OllamaEmbedInput.schema.json +1 -0
  27. package/.pikku/schemas/schemas/OllamaEmbedManyInput.schema.json +1 -0
  28. package/.pikku/schemas/schemas/OllamaEmbedManyOutput.schema.json +1 -0
  29. package/.pikku/schemas/schemas/OllamaEmbedOutput.schema.json +1 -0
  30. package/.pikku/schemas/schemas/OllamaGenerateObjectInput.schema.json +1 -0
  31. package/.pikku/schemas/schemas/OllamaGenerateObjectOutput.schema.json +1 -0
  32. package/.pikku/schemas/schemas/OllamaGenerateTextInput.schema.json +1 -0
  33. package/.pikku/schemas/schemas/OllamaGenerateTextOutput.schema.json +1 -0
  34. package/.pikku/schemas/schemas/VariableSchema_ollama_base_url.schema.json +1 -0
  35. package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  36. package/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
  37. package/.pikku/secrets/pikku-secrets.gen.ts +21 -0
  38. package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  39. package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  40. package/.pikku/variables/pikku-variables-meta.gen.json +10 -0
  41. package/.pikku/variables/pikku-variables.gen.ts +23 -0
  42. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +38 -0
  43. package/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
  44. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  45. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  46. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +4 -4
  47. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
  48. package/dist/.pikku/addon/pikku-addon-types.gen.js +7 -3
  49. package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
  50. package/dist/.pikku/addon/pikku-addon-types.gen.ts +11 -6
  51. package/dist/.pikku/addon/pikku-package.gen.js +2 -1
  52. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
  53. package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
  54. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
  55. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
  56. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
  57. package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
  58. package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
  59. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
  60. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
  61. package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
  62. package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
  63. package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
  64. package/dist/.pikku/console/pikku-addon-meta.gen.json +27 -27
  65. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  66. package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
  67. package/dist/.pikku/function/pikku-function-types.gen.d.ts +71 -87
  68. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
  69. package/dist/.pikku/function/pikku-function-types.gen.js +80 -60
  70. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
  71. package/dist/.pikku/function/pikku-function-types.gen.ts +170 -102
  72. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +56 -44
  73. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  74. package/dist/.pikku/function/pikku-functions-meta.gen.json +42 -38
  75. package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
  76. package/dist/.pikku/function/pikku-functions.gen.js +2 -2
  77. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
  78. package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
  79. package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
  80. package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
  81. package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
  82. package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
  83. package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
  84. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
  85. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
  86. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
  87. package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
  88. package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
  89. package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
  90. package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
  91. package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
  92. package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
  93. package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
  94. package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
  95. package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
  96. package/dist/.pikku/pikku-meta-service.gen.js +10 -0
  97. package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
  98. package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
  99. package/dist/.pikku/pikku-services.gen.d.ts +10 -2
  100. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
  101. package/dist/.pikku/pikku-services.gen.js +9 -0
  102. package/dist/.pikku/pikku-services.gen.js.map +1 -1
  103. package/dist/.pikku/pikku-services.gen.ts +12 -2
  104. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  105. package/dist/.pikku/pikku-types.gen.js +1 -1
  106. package/dist/.pikku/pikku-types.gen.ts +1 -1
  107. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
  108. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
  109. package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
  110. package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
  111. package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
  112. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +81 -62
  113. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +84 -65
  114. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
  115. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
  116. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
  117. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
  118. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +6 -0
  119. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
  120. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
  121. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
  122. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
  123. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
  124. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
  125. package/dist/.pikku/schemas/register.gen.js +11 -11
  126. package/dist/.pikku/schemas/register.gen.js.map +1 -1
  127. package/dist/.pikku/schemas/register.gen.ts +17 -17
  128. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  129. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  130. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
  131. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  132. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  133. package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
  134. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  135. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  136. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
  137. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  138. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  139. package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
  140. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  141. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  142. package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
  143. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
  144. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +36 -27
  145. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
  146. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -18
  147. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
  148. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
  149. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  150. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
  151. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  152. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  153. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
  154. package/dist/src/functions/text/generate-object.function.d.ts +4 -4
  155. package/package.json +7 -6
  156. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
  157. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
  158. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
  159. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
  160. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
  161. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
  162. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
  163. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
  164. package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
  165. package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
  166. package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
@@ -0,0 +1,207 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
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 OllamaEmbedInput = {
13
+ /** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
14
+ model: string;
15
+ /** The text to embed */
16
+ value: string;
17
+ }
18
+ export type OllamaEmbedManyInput = {
19
+ /** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
20
+ model: string;
21
+ /** The texts to embed */
22
+ values: string[];
23
+ }
24
+ export type OllamaEmbedManyOutput = {
25
+ /** The embedding vectors */
26
+ embeddings: number[][];
27
+ /** Token usage statistics */
28
+ usage: {
29
+ /** Number of tokens used */
30
+ tokens: number;
31
+ };
32
+ }
33
+ export type OllamaEmbedOutput = {
34
+ /** The embedding vector */
35
+ embedding: number[];
36
+ /** Token usage statistics */
37
+ usage: {
38
+ /** Number of tokens used */
39
+ tokens: number;
40
+ };
41
+ }
42
+ export type OllamaGenerateObjectInput = {
43
+ /** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
44
+ model: string;
45
+ /** The prompt to generate a structured object from */
46
+ prompt?: string | undefined;
47
+ /** A list of messages comprising the conversation so far */
48
+ messages?: {
49
+ /** The role of the message author */
50
+ role: "system" | "user" | "assistant";
51
+ /** The contents of the message */
52
+ content: string;
53
+ }[] | undefined;
54
+ /** System message to set the behavior of the model */
55
+ system?: string | undefined;
56
+ /** JSON Schema describing the expected output object */
57
+ schema: {
58
+ [key: string]: any;
59
+ };
60
+ /** Optional name for the schema */
61
+ schemaName?: string | undefined;
62
+ /** Optional description of what the schema represents */
63
+ schemaDescription?: string | undefined;
64
+ /** Mode for object generation. Use "json" for models that do not support tools. */
65
+ mode?: ("auto" | "tool" | "json") | undefined;
66
+ /** Maximum number of tokens to generate */
67
+ maxTokens?: number | undefined;
68
+ /** Sampling temperature between 0 and 2 */
69
+ temperature?: number | undefined;
70
+ }
71
+ export type OllamaGenerateObjectOutput = {
72
+ /** The generated structured object */
73
+ object: any;
74
+ /** The reason the model stopped generating */
75
+ finishReason: string;
76
+ /** Token usage statistics */
77
+ usage: {
78
+ /** Number of tokens in the prompt */
79
+ promptTokens: number;
80
+ /** Number of tokens in the completion */
81
+ completionTokens: number;
82
+ /** Total number of tokens used */
83
+ totalTokens: number;
84
+ };
85
+ }
86
+ export type OllamaGenerateTextInput = {
87
+ /** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
88
+ model: string;
89
+ /** The prompt to generate text from */
90
+ prompt?: string | undefined;
91
+ /** A list of messages comprising the conversation so far */
92
+ messages?: {
93
+ /** The role of the message author */
94
+ role: "system" | "user" | "assistant";
95
+ /** The contents of the message */
96
+ content: string;
97
+ }[] | undefined;
98
+ /** System message to set the behavior of the model */
99
+ system?: string | undefined;
100
+ /** Maximum number of tokens to generate */
101
+ maxTokens?: number | undefined;
102
+ /** Sampling temperature between 0 and 2 */
103
+ temperature?: number | undefined;
104
+ /** Nucleus sampling parameter */
105
+ topP?: number | undefined;
106
+ /** Random seed for reproducible results */
107
+ seed?: number | undefined;
108
+ }
109
+ export type OllamaGenerateTextOutput = {
110
+ /** The generated text */
111
+ text: string;
112
+ /** The reason the model stopped generating */
113
+ finishReason: string;
114
+ /** Token usage statistics */
115
+ usage: {
116
+ /** Number of tokens in the prompt */
117
+ promptTokens: number;
118
+ /** Number of tokens in the completion */
119
+ completionTokens: number;
120
+ /** Total number of tokens used */
121
+ totalTokens: 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
+ };
133
+
134
+
135
+
136
+ // No addon packages, use RPCMap directly
137
+ export type FlattenedRPCMap = RPCMap
138
+
139
+ type IsAny<T> = 0 extends (1 & T) ? true : false
140
+ type IsVoidishInput<T> = IsAny<T> extends true
141
+ ? false
142
+ : [T] extends [void | null | undefined]
143
+ ? true
144
+ : false
145
+
146
+
147
+ export type RPCInvoke = <Name extends keyof FlattenedRPCMap>(
148
+ ...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
149
+ ? [name: Name]
150
+ : [name: Name, data: FlattenedRPCMap[Name]['input']]
151
+ ) => Promise<FlattenedRPCMap[Name]['output']>
152
+
153
+ export type RPCRemote = <Name extends keyof FlattenedRPCMap>(
154
+ ...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
155
+ ? [name: Name]
156
+ : [name: Name, data: FlattenedRPCMap[Name]['input']]
157
+ ) => Promise<FlattenedRPCMap[Name]['output']>
158
+
159
+ import type { FlattenedWorkflowMap } from '../workflow/pikku-workflow-map.gen.d.js'
160
+
161
+ import type { AgentMap } from '../agent/pikku-agent-map.gen.d.js'
162
+
163
+
164
+ type FlattenedAgentMap = AgentMap
165
+
166
+
167
+ import type { PikkuRPC } from '@pikku/core/rpc'
168
+
169
+ interface AIAgentInput {
170
+ message: string
171
+ threadId: string
172
+ resourceId: string
173
+ }
174
+
175
+ export type TypedStartWorkflow = <Name extends keyof FlattenedWorkflowMap>(
176
+ name: Name,
177
+ input: FlattenedWorkflowMap[Name]['input'],
178
+ options?: { startNode?: string }
179
+ ) => Promise<{ runId: string }>
180
+
181
+ export type TypedRunWorkflow = <Name extends keyof FlattenedWorkflowMap>(
182
+ name: Name,
183
+ input: FlattenedWorkflowMap[Name]['input']
184
+ ) => Promise<FlattenedWorkflowMap[Name]['output']>
185
+
186
+ export type TypedWorkflowStatus = (
187
+ workflowName: string,
188
+ runId: string
189
+ ) => Promise<{ id: string; status: 'running' | 'suspended' | 'completed' | 'failed' | 'cancelled'; output?: unknown; error?: { message?: string } }>
190
+
191
+ type TypedAgentRun = [keyof FlattenedAgentMap] extends [never]
192
+ ? (name: string, input: AIAgentInput) => Promise<any>
193
+ : <Name extends keyof FlattenedAgentMap>(
194
+ name: Name,
195
+ input: AIAgentInput
196
+ ) => Promise<{ runId: string; result: FlattenedAgentMap[Name]['output']; usage: { inputTokens: number; outputTokens: number } }>
197
+
198
+ type TypedAgentStream = [keyof FlattenedAgentMap] extends [never]
199
+ ? (name: string, input: AIAgentInput, options?: { requiresToolApproval?: 'all' | 'explicit' | false }) => Promise<void>
200
+ : <Name extends keyof FlattenedAgentMap>(
201
+ name: Name,
202
+ input: AIAgentInput,
203
+ options?: { requiresToolApproval?: 'all' | 'explicit' | false }
204
+ ) => Promise<void>
205
+
206
+ export type TypedPikkuRPC = PikkuRPC<RPCInvoke, RPCRemote, TypedStartWorkflow, TypedAgentRun, TypedAgentStream>
207
+
@@ -0,0 +1,211 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
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 OllamaEmbedInput = {
13
+ /** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
14
+ model: string;
15
+ /** The text to embed */
16
+ value: string;
17
+ }
18
+ export type OllamaEmbedManyInput = {
19
+ /** The Ollama embedding model to use (e.g. "nomic-embed-text", "mxbai-embed-large") */
20
+ model: string;
21
+ /** The texts to embed */
22
+ values: string[];
23
+ }
24
+ export type OllamaEmbedManyOutput = {
25
+ /** The embedding vectors */
26
+ embeddings: number[][];
27
+ /** Token usage statistics */
28
+ usage: {
29
+ /** Number of tokens used */
30
+ tokens: number;
31
+ };
32
+ }
33
+ export type OllamaEmbedOutput = {
34
+ /** The embedding vector */
35
+ embedding: number[];
36
+ /** Token usage statistics */
37
+ usage: {
38
+ /** Number of tokens used */
39
+ tokens: number;
40
+ };
41
+ }
42
+ export type OllamaGenerateObjectInput = {
43
+ /** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
44
+ model: string;
45
+ /** The prompt to generate a structured object from */
46
+ prompt?: string | undefined;
47
+ /** A list of messages comprising the conversation so far */
48
+ messages?: {
49
+ /** The role of the message author */
50
+ role: "system" | "user" | "assistant";
51
+ /** The contents of the message */
52
+ content: string;
53
+ }[] | undefined;
54
+ /** System message to set the behavior of the model */
55
+ system?: string | undefined;
56
+ /** JSON Schema describing the expected output object */
57
+ schema: {
58
+ [key: string]: any;
59
+ };
60
+ /** Optional name for the schema */
61
+ schemaName?: string | undefined;
62
+ /** Optional description of what the schema represents */
63
+ schemaDescription?: string | undefined;
64
+ /** Mode for object generation. Use "json" for models that do not support tools. */
65
+ mode?: ("auto" | "tool" | "json") | undefined;
66
+ /** Maximum number of tokens to generate */
67
+ maxTokens?: number | undefined;
68
+ /** Sampling temperature between 0 and 2 */
69
+ temperature?: number | undefined;
70
+ }
71
+ export type OllamaGenerateObjectOutput = {
72
+ /** The generated structured object */
73
+ object: any;
74
+ /** The reason the model stopped generating */
75
+ finishReason: string;
76
+ /** Token usage statistics */
77
+ usage: {
78
+ /** Number of tokens in the prompt */
79
+ promptTokens: number;
80
+ /** Number of tokens in the completion */
81
+ completionTokens: number;
82
+ /** Total number of tokens used */
83
+ totalTokens: number;
84
+ };
85
+ }
86
+ export type OllamaGenerateTextInput = {
87
+ /** The Ollama model to use (e.g. "llama3.2", "phi3:mini") */
88
+ model: string;
89
+ /** The prompt to generate text from */
90
+ prompt?: string | undefined;
91
+ /** A list of messages comprising the conversation so far */
92
+ messages?: {
93
+ /** The role of the message author */
94
+ role: "system" | "user" | "assistant";
95
+ /** The contents of the message */
96
+ content: string;
97
+ }[] | undefined;
98
+ /** System message to set the behavior of the model */
99
+ system?: string | undefined;
100
+ /** Maximum number of tokens to generate */
101
+ maxTokens?: number | undefined;
102
+ /** Sampling temperature between 0 and 2 */
103
+ temperature?: number | undefined;
104
+ /** Nucleus sampling parameter */
105
+ topP?: number | undefined;
106
+ /** Random seed for reproducible results */
107
+ seed?: number | undefined;
108
+ }
109
+ export type OllamaGenerateTextOutput = {
110
+ /** The generated text */
111
+ text: string;
112
+ /** The reason the model stopped generating */
113
+ finishReason: string;
114
+ /** Token usage statistics */
115
+ usage: {
116
+ /** Number of tokens in the prompt */
117
+ promptTokens: number;
118
+ /** Number of tokens in the completion */
119
+ completionTokens: number;
120
+ /** Total number of tokens used */
121
+ totalTokens: 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 'ollamaEmbedMany': RPCHandler<OllamaEmbedManyInput, OllamaEmbedManyOutput>,
133
+ readonly 'ollamaEmbed': RPCHandler<OllamaEmbedInput, OllamaEmbedOutput>,
134
+ readonly 'ollamaGenerateObject': RPCHandler<OllamaGenerateObjectInput, OllamaGenerateObjectOutput>,
135
+ readonly 'ollamaGenerateText': RPCHandler<OllamaGenerateTextInput, OllamaGenerateTextOutput>,
136
+ };
137
+
138
+
139
+
140
+ // No addon packages, use RPCMap directly
141
+ export type FlattenedRPCMap = RPCMap
142
+
143
+ type IsAny<T> = 0 extends (1 & T) ? true : false
144
+ type IsVoidishInput<T> = IsAny<T> extends true
145
+ ? false
146
+ : [T] extends [void | null | undefined]
147
+ ? true
148
+ : false
149
+
150
+
151
+ export type RPCInvoke = <Name extends keyof FlattenedRPCMap>(
152
+ ...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
153
+ ? [name: Name]
154
+ : [name: Name, data: FlattenedRPCMap[Name]['input']]
155
+ ) => Promise<FlattenedRPCMap[Name]['output']>
156
+
157
+ export type RPCRemote = <Name extends keyof FlattenedRPCMap>(
158
+ ...args: IsVoidishInput<FlattenedRPCMap[Name]['input']> extends true
159
+ ? [name: Name]
160
+ : [name: Name, data: FlattenedRPCMap[Name]['input']]
161
+ ) => Promise<FlattenedRPCMap[Name]['output']>
162
+
163
+ import type { FlattenedWorkflowMap } from '../workflow/pikku-workflow-map.gen.d.js'
164
+
165
+ import type { AgentMap } from '../agent/pikku-agent-map.gen.d.js'
166
+
167
+
168
+ type FlattenedAgentMap = AgentMap
169
+
170
+
171
+ import type { PikkuRPC } from '@pikku/core/rpc'
172
+
173
+ interface AIAgentInput {
174
+ message: string
175
+ threadId: string
176
+ resourceId: string
177
+ }
178
+
179
+ export type TypedStartWorkflow = <Name extends keyof FlattenedWorkflowMap>(
180
+ name: Name,
181
+ input: FlattenedWorkflowMap[Name]['input'],
182
+ options?: { startNode?: string }
183
+ ) => Promise<{ runId: string }>
184
+
185
+ export type TypedRunWorkflow = <Name extends keyof FlattenedWorkflowMap>(
186
+ name: Name,
187
+ input: FlattenedWorkflowMap[Name]['input']
188
+ ) => Promise<FlattenedWorkflowMap[Name]['output']>
189
+
190
+ export type TypedWorkflowStatus = (
191
+ workflowName: string,
192
+ runId: string
193
+ ) => Promise<{ id: string; status: 'running' | 'suspended' | 'completed' | 'failed' | 'cancelled'; output?: unknown; error?: { message?: string } }>
194
+
195
+ type TypedAgentRun = [keyof FlattenedAgentMap] extends [never]
196
+ ? (name: string, input: AIAgentInput) => Promise<any>
197
+ : <Name extends keyof FlattenedAgentMap>(
198
+ name: Name,
199
+ input: AIAgentInput
200
+ ) => Promise<{ runId: string; result: FlattenedAgentMap[Name]['output']; usage: { inputTokens: number; outputTokens: number } }>
201
+
202
+ type TypedAgentStream = [keyof FlattenedAgentMap] extends [never]
203
+ ? (name: string, input: AIAgentInput, options?: { requiresToolApproval?: 'all' | 'explicit' | false }) => Promise<void>
204
+ : <Name extends keyof FlattenedAgentMap>(
205
+ name: Name,
206
+ input: AIAgentInput,
207
+ options?: { requiresToolApproval?: 'all' | 'explicit' | false }
208
+ ) => Promise<void>
209
+
210
+ export type TypedPikkuRPC = PikkuRPC<RPCInvoke, RPCRemote, TypedStartWorkflow, TypedAgentRun, TypedAgentStream>
211
+
@@ -0,0 +1,6 @@
1
+ {
2
+ "ollamaEmbedMany": "ollamaEmbedMany",
3
+ "ollamaEmbed": "ollamaEmbed",
4
+ "ollamaGenerateObject": "ollamaGenerateObject",
5
+ "ollamaGenerateText": "ollamaGenerateText"
6
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { pikkuState } from '@pikku/core/internal'
5
+ import metaData from './pikku-rpc-wirings-meta.internal.gen.json' with { type: 'json' }
6
+ pikkuState('@pikku/addon-ollama', 'rpc', 'meta', metaData as Record<string, string>)
@@ -0,0 +1,25 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ /**
5
+ * Scheduler-specific type definitions for tree-shaking optimization
6
+ */
7
+
8
+ import { CoreScheduledTask, wireScheduler as wireSchedulerCore } from '@pikku/core/scheduler'
9
+ import type { PikkuFunctionConfig, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
10
+
11
+ /**
12
+ * Type definition for scheduled tasks that run at specified intervals.
13
+ * These are sessionless functions that execute based on cron expressions.
14
+ */
15
+ type SchedulerWiring = CoreScheduledTask<PikkuFunctionConfig<void, void, 'session' | 'rpc'>, PikkuMiddleware>
16
+
17
+ /**
18
+ * Registers a scheduled task with the Pikku framework.
19
+ * Tasks run based on cron expressions and are sessionless.
20
+ *
21
+ * @param task - Scheduled task definition with cron expression and handler
22
+ */
23
+ export const wireScheduler = (task: SchedulerWiring) => {
24
+ wireSchedulerCore(task as any)
25
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ import { addSchema } from '@pikku/core/schema'
5
+
6
+ import * as OllamaEmbedInput from './schemas/OllamaEmbedInput.schema.json' with { type: 'json' }
7
+ addSchema('OllamaEmbedInput', OllamaEmbedInput, '@pikku/addon-ollama')
8
+
9
+
10
+ import * as OllamaEmbedManyInput from './schemas/OllamaEmbedManyInput.schema.json' with { type: 'json' }
11
+ addSchema('OllamaEmbedManyInput', OllamaEmbedManyInput, '@pikku/addon-ollama')
12
+
13
+
14
+ import * as OllamaEmbedManyOutput from './schemas/OllamaEmbedManyOutput.schema.json' with { type: 'json' }
15
+ addSchema('OllamaEmbedManyOutput', OllamaEmbedManyOutput, '@pikku/addon-ollama')
16
+
17
+
18
+ import * as OllamaEmbedOutput from './schemas/OllamaEmbedOutput.schema.json' with { type: 'json' }
19
+ addSchema('OllamaEmbedOutput', OllamaEmbedOutput, '@pikku/addon-ollama')
20
+
21
+
22
+ import * as OllamaGenerateObjectInput from './schemas/OllamaGenerateObjectInput.schema.json' with { type: 'json' }
23
+ addSchema('OllamaGenerateObjectInput', OllamaGenerateObjectInput, '@pikku/addon-ollama')
24
+
25
+
26
+ import * as OllamaGenerateObjectOutput from './schemas/OllamaGenerateObjectOutput.schema.json' with { type: 'json' }
27
+ addSchema('OllamaGenerateObjectOutput', OllamaGenerateObjectOutput, '@pikku/addon-ollama')
28
+
29
+
30
+ import * as OllamaGenerateTextInput from './schemas/OllamaGenerateTextInput.schema.json' with { type: 'json' }
31
+ addSchema('OllamaGenerateTextInput', OllamaGenerateTextInput, '@pikku/addon-ollama')
32
+
33
+
34
+ import * as OllamaGenerateTextOutput from './schemas/OllamaGenerateTextOutput.schema.json' with { type: 'json' }
35
+ addSchema('OllamaGenerateTextOutput', OllamaGenerateTextOutput, '@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,5 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
3
+ */
4
+ export { wireSecret } from '@pikku/core/secret'
5
+ export type { CoreSecret, SecretDefinitionMeta, SecretDefinitionsMeta } from '@pikku/core/secret'
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.55
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
+ }