@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.
Files changed (194) hide show
  1. package/.pikku/addon/pikku-addon-types.gen.ts +78 -0
  2. package/.pikku/addon/pikku-package.gen.ts +9 -0
  3. package/.pikku/agent/pikku-agent-map.gen.d.ts +16 -0
  4. package/.pikku/agent/pikku-agent-types.gen.ts +76 -0
  5. package/.pikku/agent/pikku-agent-wirings-meta.gen.json +3 -0
  6. package/.pikku/agent/pikku-agent-wirings-meta.gen.ts +7 -0
  7. package/.pikku/agent/pikku-agent-wirings.gen.ts +3 -0
  8. package/.pikku/console/pikku-node-types.gen.ts +8 -0
  9. package/.pikku/console/pikku-nodes-meta.gen.json +57 -0
  10. package/.pikku/function/pikku-function-types.gen.ts +648 -0
  11. package/.pikku/function/pikku-functions-meta-verbose.gen.json +106 -0
  12. package/.pikku/function/pikku-functions-meta.gen.json +74 -0
  13. package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
  14. package/.pikku/function/pikku-functions.gen.ts +14 -0
  15. package/.pikku/pikku-bootstrap.gen.ts +15 -0
  16. package/.pikku/pikku-services.gen.ts +33 -0
  17. package/.pikku/pikku-types.gen.ts +21 -0
  18. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +188 -0
  19. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +192 -0
  20. package/.pikku/schemas/register.gen.ts +39 -0
  21. package/.pikku/schemas/schemas/OllamaEmbedInput.schema.json +1 -0
  22. package/.pikku/schemas/schemas/OllamaEmbedManyInput.schema.json +1 -0
  23. package/.pikku/schemas/schemas/OllamaEmbedManyOutput.schema.json +1 -0
  24. package/.pikku/schemas/schemas/OllamaEmbedOutput.schema.json +1 -0
  25. package/.pikku/schemas/schemas/OllamaGenerateObjectInput.schema.json +1 -0
  26. package/.pikku/schemas/schemas/OllamaGenerateObjectOutput.schema.json +1 -0
  27. package/.pikku/schemas/schemas/OllamaGenerateTextInput.schema.json +1 -0
  28. package/.pikku/schemas/schemas/OllamaGenerateTextOutput.schema.json +1 -0
  29. package/.pikku/schemas/schemas/VariableSchema_ollama_base_url.schema.json +1 -0
  30. package/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  31. package/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
  32. package/.pikku/secrets/pikku-secrets.gen.ts +21 -0
  33. package/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  34. package/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  35. package/.pikku/variables/pikku-variables-meta.gen.json +10 -0
  36. package/.pikku/variables/pikku-variables.gen.ts +23 -0
  37. package/.pikku/workflow/pikku-workflow-map.gen.d.ts +34 -0
  38. package/.pikku/workflow/pikku-workflow-types.gen.ts +158 -0
  39. package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  40. package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  41. package/README.md +19 -0
  42. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +49 -0
  43. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -0
  44. package/dist/.pikku/addon/pikku-addon-types.gen.js +55 -0
  45. package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -0
  46. package/dist/.pikku/addon/pikku-addon-types.gen.ts +78 -0
  47. package/dist/.pikku/addon/pikku-package.gen.d.ts +2 -0
  48. package/dist/.pikku/addon/pikku-package.gen.d.ts.map +1 -0
  49. package/dist/.pikku/addon/pikku-package.gen.js +9 -0
  50. package/dist/.pikku/addon/pikku-package.gen.js.map +1 -0
  51. package/dist/.pikku/addon/pikku-package.gen.ts +9 -0
  52. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +16 -0
  53. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +47 -0
  54. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -0
  55. package/dist/.pikku/agent/pikku-agent-types.gen.js +18 -0
  56. package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -0
  57. package/dist/.pikku/agent/pikku-agent-types.gen.ts +76 -0
  58. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +2 -0
  59. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +1 -0
  60. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +7 -0
  61. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +1 -0
  62. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +3 -0
  63. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +7 -0
  64. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +5 -0
  65. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +1 -0
  66. package/dist/.pikku/agent/pikku-agent-wirings.gen.js +5 -0
  67. package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +1 -0
  68. package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +3 -0
  69. package/dist/.pikku/console/pikku-node-types.gen.d.ts +7 -0
  70. package/dist/.pikku/console/pikku-node-types.gen.d.ts.map +1 -0
  71. package/dist/.pikku/console/pikku-node-types.gen.js +2 -0
  72. package/dist/.pikku/console/pikku-node-types.gen.js.map +1 -0
  73. package/dist/.pikku/console/pikku-node-types.gen.ts +8 -0
  74. package/dist/.pikku/console/pikku-nodes-meta.gen.json +57 -0
  75. package/dist/.pikku/function/pikku-function-types.gen.d.ts +477 -0
  76. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -0
  77. package/dist/.pikku/function/pikku-function-types.gen.js +298 -0
  78. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -0
  79. package/dist/.pikku/function/pikku-function-types.gen.ts +648 -0
  80. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +106 -0
  81. package/dist/.pikku/function/pikku-functions-meta.gen.d.ts +2 -0
  82. package/dist/.pikku/function/pikku-functions-meta.gen.d.ts.map +1 -0
  83. package/dist/.pikku/function/pikku-functions-meta.gen.js +7 -0
  84. package/dist/.pikku/function/pikku-functions-meta.gen.js.map +1 -0
  85. package/dist/.pikku/function/pikku-functions-meta.gen.json +74 -0
  86. package/dist/.pikku/function/pikku-functions-meta.gen.ts +7 -0
  87. package/dist/.pikku/function/pikku-functions.gen.d.ts +2 -0
  88. package/dist/.pikku/function/pikku-functions.gen.d.ts.map +1 -0
  89. package/dist/.pikku/function/pikku-functions.gen.js +14 -0
  90. package/dist/.pikku/function/pikku-functions.gen.js.map +1 -0
  91. package/dist/.pikku/function/pikku-functions.gen.ts +14 -0
  92. package/dist/.pikku/pikku-bootstrap.gen.d.ts +7 -0
  93. package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -0
  94. package/dist/.pikku/pikku-bootstrap.gen.js +17 -0
  95. package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -0
  96. package/dist/.pikku/pikku-bootstrap.gen.ts +15 -0
  97. package/dist/.pikku/pikku-services.gen.d.ts +26 -0
  98. package/dist/.pikku/pikku-services.gen.d.ts.map +1 -0
  99. package/dist/.pikku/pikku-services.gen.js +21 -0
  100. package/dist/.pikku/pikku-services.gen.js.map +1 -0
  101. package/dist/.pikku/pikku-services.gen.ts +33 -0
  102. package/dist/.pikku/pikku-types.gen.d.ts +12 -0
  103. package/dist/.pikku/pikku-types.gen.d.ts.map +1 -0
  104. package/dist/.pikku/pikku-types.gen.js +17 -0
  105. package/dist/.pikku/pikku-types.gen.js.map +1 -0
  106. package/dist/.pikku/pikku-types.gen.ts +21 -0
  107. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +188 -0
  108. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +192 -0
  109. package/dist/.pikku/schemas/register.gen.d.ts +2 -0
  110. package/dist/.pikku/schemas/register.gen.d.ts.map +1 -0
  111. package/dist/.pikku/schemas/register.gen.js +23 -0
  112. package/dist/.pikku/schemas/register.gen.js.map +1 -0
  113. package/dist/.pikku/schemas/register.gen.ts +39 -0
  114. package/dist/.pikku/schemas/schemas/OllamaEmbedInput.schema.json +1 -0
  115. package/dist/.pikku/schemas/schemas/OllamaEmbedManyInput.schema.json +1 -0
  116. package/dist/.pikku/schemas/schemas/OllamaEmbedManyOutput.schema.json +1 -0
  117. package/dist/.pikku/schemas/schemas/OllamaEmbedOutput.schema.json +1 -0
  118. package/dist/.pikku/schemas/schemas/OllamaGenerateObjectInput.schema.json +1 -0
  119. package/dist/.pikku/schemas/schemas/OllamaGenerateObjectOutput.schema.json +1 -0
  120. package/dist/.pikku/schemas/schemas/OllamaGenerateTextInput.schema.json +1 -0
  121. package/dist/.pikku/schemas/schemas/OllamaGenerateTextOutput.schema.json +1 -0
  122. package/dist/.pikku/schemas/schemas/VariableSchema_ollama_base_url.schema.json +1 -0
  123. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +6 -0
  124. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts.map +1 -0
  125. package/dist/.pikku/secrets/pikku-secret-types.gen.js +5 -0
  126. package/dist/.pikku/secrets/pikku-secret-types.gen.js.map +1 -0
  127. package/dist/.pikku/secrets/pikku-secret-types.gen.ts +5 -0
  128. package/dist/.pikku/secrets/pikku-secrets-meta.gen.json +1 -0
  129. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +12 -0
  130. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts.map +1 -0
  131. package/dist/.pikku/secrets/pikku-secrets.gen.js +11 -0
  132. package/dist/.pikku/secrets/pikku-secrets.gen.js.map +1 -0
  133. package/dist/.pikku/secrets/pikku-secrets.gen.ts +21 -0
  134. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +114 -0
  135. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts.map +1 -0
  136. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +34 -0
  137. package/dist/.pikku/trigger/pikku-trigger-types.gen.js.map +1 -0
  138. package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +160 -0
  139. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +6 -0
  140. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts.map +1 -0
  141. package/dist/.pikku/variables/pikku-variable-types.gen.js +5 -0
  142. package/dist/.pikku/variables/pikku-variable-types.gen.js.map +1 -0
  143. package/dist/.pikku/variables/pikku-variable-types.gen.ts +5 -0
  144. package/dist/.pikku/variables/pikku-variables-meta.gen.json +10 -0
  145. package/dist/.pikku/variables/pikku-variables.gen.d.ts +15 -0
  146. package/dist/.pikku/variables/pikku-variables.gen.d.ts.map +1 -0
  147. package/dist/.pikku/variables/pikku-variables.gen.js +13 -0
  148. package/dist/.pikku/variables/pikku-variables.gen.js.map +1 -0
  149. package/dist/.pikku/variables/pikku-variables.gen.ts +23 -0
  150. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +34 -0
  151. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +81 -0
  152. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -0
  153. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +31 -0
  154. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -0
  155. package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +158 -0
  156. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts +2 -0
  157. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts.map +1 -0
  158. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +7 -0
  159. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js.map +1 -0
  160. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
  161. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +5 -0
  162. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts.map +1 -0
  163. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +5 -0
  164. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js.map +1 -0
  165. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
  166. package/dist/src/functions/embeddings/embed-many.function.d.ts +37 -0
  167. package/dist/src/functions/embeddings/embed-many.function.d.ts.map +1 -0
  168. package/dist/src/functions/embeddings/embed-many.function.js +31 -0
  169. package/dist/src/functions/embeddings/embed-many.function.js.map +1 -0
  170. package/dist/src/functions/embeddings/embed.function.d.ts +37 -0
  171. package/dist/src/functions/embeddings/embed.function.d.ts.map +1 -0
  172. package/dist/src/functions/embeddings/embed.function.js +31 -0
  173. package/dist/src/functions/embeddings/embed.function.js.map +1 -0
  174. package/dist/src/functions/text/generate-object.function.d.ts +101 -0
  175. package/dist/src/functions/text/generate-object.function.d.ts.map +1 -0
  176. package/dist/src/functions/text/generate-object.function.js +56 -0
  177. package/dist/src/functions/text/generate-object.function.js.map +1 -0
  178. package/dist/src/functions/text/generate.function.d.ts +89 -0
  179. package/dist/src/functions/text/generate.function.d.ts.map +1 -0
  180. package/dist/src/functions/text/generate.function.js +51 -0
  181. package/dist/src/functions/text/generate.function.js.map +1 -0
  182. package/dist/src/index.d.ts +5 -0
  183. package/dist/src/index.d.ts.map +1 -0
  184. package/dist/src/index.js +7 -0
  185. package/dist/src/index.js.map +1 -0
  186. package/dist/src/ollama.variable.d.ts +3 -0
  187. package/dist/src/ollama.variable.d.ts.map +1 -0
  188. package/dist/src/ollama.variable.js +11 -0
  189. package/dist/src/ollama.variable.js.map +1 -0
  190. package/dist/src/services.d.ts +2 -0
  191. package/dist/src/services.d.ts.map +1 -0
  192. package/dist/src/services.js +11 -0
  193. package/dist/src/services.js.map +1 -0
  194. package/package.json +44 -0
@@ -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,5 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
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.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,160 @@
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
+
8
+ import { CorePikkuTriggerFunction, CorePikkuTriggerFunctionConfig, CoreTrigger, wireTrigger as wireTriggerCore, wireTriggerSource as wireTriggerSourceCore } from '@pikku/core/trigger'
9
+ import type { CoreNodeConfig } from '@pikku/core/node'
10
+ import type { SingletonServices } from '../../types/application-types.d.js'
11
+ import type { StandardSchemaV1 } from '@standard-schema/spec'
12
+
13
+
14
+
15
+ /**
16
+ * A trigger function that sets up a subscription and returns a teardown function.
17
+ * The trigger is fired via wire.trigger.invoke(data).
18
+ *
19
+ * @template TInput - Input type (configuration passed when wired)
20
+ * @template TOutput - Output type produced when trigger fires
21
+ */
22
+ export type PikkuTriggerFunction<
23
+ TInput = unknown,
24
+ TOutput = unknown
25
+ > = CorePikkuTriggerFunction<TInput, TOutput, SingletonServices>
26
+
27
+ /**
28
+ * Configuration object for creating a trigger function with metadata
29
+ */
30
+ export type PikkuTriggerFunctionConfig<
31
+ TInput = unknown,
32
+ TOutput = unknown,
33
+ InputSchema extends StandardSchemaV1 | undefined = undefined,
34
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
35
+ > = CorePikkuTriggerFunctionConfig<TInput, TOutput, SingletonServices, InputSchema, OutputSchema>
36
+
37
+ /**
38
+ * Helper type to infer the output type from a Standard Schema
39
+ */
40
+ type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never
41
+
42
+ /**
43
+ * Configuration object for trigger functions with Zod schema validation.
44
+ * Use this when you want to define input/output schemas using Zod.
45
+ * Types are automatically inferred from the schemas.
46
+ */
47
+ export type PikkuTriggerFunctionConfigWithSchema<
48
+ InputSchema extends StandardSchemaV1,
49
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
50
+ > = {
51
+ title?: string
52
+ description?: string
53
+ tags?: string[]
54
+ func: PikkuTriggerFunction<
55
+ InferSchemaOutput<InputSchema>,
56
+ OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
57
+ >
58
+ input: InputSchema
59
+ output?: OutputSchema
60
+ node?: CoreNodeConfig
61
+ }
62
+
63
+ /**
64
+ * Type definition for trigger wirings.
65
+ * Declares a trigger name and its target pikku function.
66
+ */
67
+ export type TriggerWiring = CoreTrigger
68
+
69
+ /**
70
+ * A trigger source with the subscription function, using project-specific services.
71
+ *
72
+ * @template TInput - Input type passed to the trigger function
73
+ * @template TOutput - Output type produced when trigger fires
74
+ */
75
+ export type TriggerSource<
76
+ TInput = unknown,
77
+ TOutput = unknown
78
+ > = {
79
+ name: string
80
+ func: PikkuTriggerFunctionConfig<TInput, TOutput>
81
+ } & (unknown extends TInput ? { input?: TInput } : { input: TInput })
82
+
83
+ /**
84
+ * Creates a trigger function configuration.
85
+ * Use this to define trigger functions that set up subscriptions.
86
+ *
87
+ * @param triggerOrConfig - Function definition or configuration object
88
+ * @returns The normalized configuration object
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * export const redisSubscribeTrigger = pikkuTriggerFunc<
93
+ * { channel: string },
94
+ * { message: string }
95
+ * >(async ({ redis }, { channel }, { trigger }) => {
96
+ * const subscriber = redis.duplicate()
97
+ * await subscriber.subscribe(channel, (msg) => {
98
+ * trigger.invoke({ message: msg })
99
+ * })
100
+ * return () => subscriber.unsubscribe()
101
+ * })
102
+ *
103
+ * export const redisSubscribeTrigger = pikkuTriggerFunc({
104
+ * title: 'Redis Subscribe Trigger',
105
+ * description: 'Listens to Redis pub/sub channel',
106
+ * input: z.object({ channel: z.string() }),
107
+ * output: z.object({ message: z.string() }),
108
+ * func: async ({ redis }, { channel }, { trigger }) => {
109
+ * const subscriber = redis.duplicate()
110
+ * await subscriber.subscribe(channel, (msg) => {
111
+ * trigger.invoke({ message: msg })
112
+ * })
113
+ * return () => subscriber.unsubscribe()
114
+ * }
115
+ * })
116
+ * ```
117
+ */
118
+ export function pikkuTriggerFunc<
119
+ InputSchema extends StandardSchemaV1,
120
+ OutputSchema extends StandardSchemaV1 | undefined = undefined
121
+ >(
122
+ config: PikkuTriggerFunctionConfigWithSchema<InputSchema, OutputSchema>
123
+ ): PikkuTriggerFunctionConfig<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, InputSchema, OutputSchema>
124
+ export function pikkuTriggerFunc<TInput, TOutput = unknown>(
125
+ triggerOrConfig:
126
+ | PikkuTriggerFunction<TInput, TOutput>
127
+ | PikkuTriggerFunctionConfig<TInput, TOutput>
128
+ ): PikkuTriggerFunctionConfig<TInput, TOutput>
129
+ export function pikkuTriggerFunc(triggerOrConfig: any) {
130
+ if (typeof triggerOrConfig === 'function') {
131
+ return { func: triggerOrConfig }
132
+ }
133
+ return triggerOrConfig
134
+ }
135
+
136
+ /**
137
+ * Registers a trigger with the Pikku framework.
138
+ * Declares a trigger name and its target pikku function.
139
+ * Runs everywhere — inspector extracts at build time.
140
+ *
141
+ * @param trigger - Trigger definition with name and function config
142
+ */
143
+ export const wireTrigger = (
144
+ trigger: TriggerWiring
145
+ ) => {
146
+ wireTriggerCore(trigger as any)
147
+ }
148
+
149
+ /**
150
+ * Registers a trigger source with the Pikku framework.
151
+ * Provides the subscription function and input data.
152
+ * Only imported in the trigger worker process.
153
+ *
154
+ * @param source - Trigger source with name, func, and input
155
+ */
156
+ export const wireTriggerSource = <TInput = unknown, TOutput = unknown>(
157
+ source: TriggerSource<TInput, TOutput>
158
+ ) => {
159
+ wireTriggerSourceCore(source as any)
160
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
4
+ export { wireVariable } from '@pikku/core/variable'
5
+ export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable'
@@ -0,0 +1,10 @@
1
+ {
2
+ "ollama_base_url": {
3
+ "name": "ollama_base_url",
4
+ "displayName": "Ollama Base URL",
5
+ "description": "Base URL for the Ollama API",
6
+ "variableId": "OLLAMA_BASE_URL",
7
+ "schema": "VariableSchema_ollama_base_url",
8
+ "sourceFile": "/Users/yasser/git/pikku/addons/packages/ai/ollama/src/ollama.variable.ts"
9
+ }
10
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
4
+ import { TypedVariablesService as CoreTypedVariablesService, type VariableMeta } from '@pikku/core/services'
5
+ import type { VariablesService } from '@pikku/core/services'
6
+ import type { z } from 'zod'
7
+ import { ollamaBaseUrlSchema } from '../../src/ollama.variable.js'
8
+
9
+ export interface VariablesMap {
10
+ 'OLLAMA_BASE_URL': z.infer<typeof ollamaBaseUrlSchema>
11
+ }
12
+
13
+ export type VariableId = keyof VariablesMap
14
+
15
+ const VARIABLES_META: Record<string, VariableMeta> = {
16
+ 'OLLAMA_BASE_URL': { name: 'ollama_base_url', displayName: 'Ollama Base URL' }
17
+ }
18
+
19
+ export class TypedVariablesService extends CoreTypedVariablesService<VariablesMap> {
20
+ constructor(variables: VariablesService) {
21
+ super(variables, VARIABLES_META)
22
+ }
23
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
4
+ /**
5
+ * Workflow type map with input/output types for each workflow
6
+ */
7
+
8
+
9
+
10
+
11
+ interface WorkflowHandler<I, O> {
12
+ input: I;
13
+ output: O;
14
+ }
15
+
16
+ interface GraphNodeHandler<I> {
17
+ input: I;
18
+ }
19
+
20
+ export type WorkflowMap = {
21
+ };
22
+
23
+ export type GraphsMap = {
24
+ };
25
+
26
+ export type WorkflowClient<Name extends keyof WorkflowMap> = {
27
+ start: (input: WorkflowMap[Name]['input']) => Promise<{ runId: string }>;
28
+ getRun: <output extends keyof WorkflowMap[Name]>(runId: string) => Promise<WorkflowMap[Name][output]>;
29
+ cancelRun: (runId: string) => Promise<boolean>;
30
+ }
31
+
32
+ export type TypedWorkflowClients = {
33
+ [Name in keyof WorkflowMap]: WorkflowClient<Name>;
34
+ }
@@ -0,0 +1,158 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
4
+ import { WorkflowCancelledException } from '@pikku/core/workflow'
5
+ import {
6
+ workflow as coreWorkflow,
7
+ workflowStart as coreWorkflowStart,
8
+ workflowStatus as coreWorkflowStatus,
9
+ graphStart as coreGraphStart,
10
+ } from '@pikku/core/workflow'
11
+ import { template } from '@pikku/core/workflow'
12
+ import {
13
+ pikkuWorkflowGraph as corePikkuWorkflowGraph,
14
+ type PikkuWorkflowGraphConfig,
15
+ type PikkuWorkflowGraphResult,
16
+ } from '@pikku/core/workflow'
17
+ import type { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow'
18
+
19
+ export { WorkflowCancelledException }
20
+ import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
21
+ import type { RPCMap, FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
22
+ import type { WorkflowMap, GraphsMap } from './pikku-workflow-map.gen.d.js'
23
+
24
+ export { template }
25
+
26
+ export interface TypedWorkflow extends PikkuWorkflowWire {
27
+ do<K extends keyof RPCMap>(
28
+ stepName: string,
29
+ rpcName: K,
30
+ data: RPCMap[K]['input'],
31
+ options?: WorkflowStepOptions
32
+ ): Promise<RPCMap[K]['output']>
33
+
34
+ do<T>(
35
+ stepName: string,
36
+ fn: () => T | Promise<T>,
37
+ options?: WorkflowStepOptions
38
+ ): Promise<T>
39
+ }
40
+
41
+ export type PikkuFunctionWorkflow<
42
+ In = unknown,
43
+ Out = never
44
+ > = PikkuFunctionSessionless<In, Out, 'workflow'>
45
+
46
+ export const pikkuWorkflowFunc = <In, Out = unknown>(
47
+ func:
48
+ | PikkuFunctionWorkflow<In, Out>
49
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
50
+ ) => {
51
+ return typeof func === 'function' ? { func } : func
52
+ }
53
+
54
+ export const pikkuWorkflowComplexFunc = <In, Out = unknown>(
55
+ func:
56
+ | PikkuFunctionWorkflow<In, Out>
57
+ | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
58
+ ) => {
59
+ return typeof func === 'function' ? { func } : func
60
+ }
61
+
62
+ type TypedRef<T> = { $ref: string; path?: string } & { __phantomType?: T }
63
+
64
+ type TemplateString = {
65
+ $template: {
66
+ parts: string[]
67
+ expressions: Array<{ $ref: string; path?: string }>
68
+ }
69
+ } & { __brand: 'TemplateString' }
70
+
71
+ type InputWithRefs<T> = {
72
+ [K in keyof T]?: T[K] | TypedRef<T[K]> | TypedRef<unknown> | TemplateString
73
+ }
74
+
75
+ type NodeInputType<FuncMap extends Record<string, string>, K extends keyof FuncMap> =
76
+ FuncMap[K] extends keyof FlattenedRPCMap
77
+ ? InputWithRefs<FlattenedRPCMap[FuncMap[K]]['input']>
78
+ : Record<string, unknown>
79
+
80
+ type NodeOutputKeys<FuncMap extends Record<string, string>, N extends string> =
81
+ N extends keyof FuncMap
82
+ ? FuncMap[N] extends keyof FlattenedRPCMap
83
+ ? keyof FlattenedRPCMap[FuncMap[N]]['output'] & string
84
+ : string
85
+ : string
86
+
87
+ type RefFunction<FuncMap extends Record<string, string>> = {
88
+ <N extends Extract<keyof FuncMap, string>>(
89
+ nodeId: N,
90
+ path: NodeOutputKeys<FuncMap, N>
91
+ ): TypedRef<unknown>
92
+ (nodeId: 'trigger' | '$item', path?: string): TypedRef<unknown>
93
+ }
94
+
95
+ type TemplateFunction = (templateStr: string, refs: TypedRef<unknown>[]) => TemplateString
96
+
97
+ type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
98
+ [K in Extract<keyof FuncMap, string>]?: {
99
+ next?: NextConfig<Extract<keyof FuncMap, string>>
100
+ input?:
101
+ | NodeInputType<FuncMap, K>
102
+ | (() => NodeInputType<FuncMap, K>)
103
+ | ((ref: RefFunction<FuncMap>, template: TemplateFunction) => NodeInputType<FuncMap, K>)
104
+ onError?: Extract<keyof FuncMap, string> | Extract<keyof FuncMap, string>[]
105
+ }
106
+ }
107
+
108
+ type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
109
+
110
+ export function pikkuWorkflowGraph<
111
+ const FuncMap extends Record<string, keyof FlattenedRPCMap & string>
112
+ >(
113
+ config: PikkuWorkflowGraphConfig<FuncMap, GraphNodeConfigMap<FuncMap>>
114
+ ): PikkuWorkflowGraphResult {
115
+ return corePikkuWorkflowGraph(config as any)
116
+ }
117
+
118
+ export const workflow = <Name extends keyof WorkflowMap>(
119
+ workflowName: Name,
120
+ options?: { pollIntervalMs?: number }
121
+ ) => {
122
+ return coreWorkflow<WorkflowMap>(workflowName as string & keyof WorkflowMap, options) as PikkuFunctionConfig<
123
+ WorkflowMap[Name]['input'],
124
+ WorkflowMap[Name]['output'],
125
+ 'session' | 'rpc'
126
+ >
127
+ }
128
+
129
+ export const workflowStart = <Name extends keyof WorkflowMap>(
130
+ workflowName: Name
131
+ ) => {
132
+ return coreWorkflowStart<WorkflowMap>(workflowName as string & keyof WorkflowMap) as PikkuFunctionConfig<
133
+ WorkflowMap[Name]['input'],
134
+ { runId: string },
135
+ 'session' | 'rpc'
136
+ >
137
+ }
138
+
139
+ export const workflowStatus = <Name extends keyof WorkflowMap>(
140
+ _workflowName: Name
141
+ ) => {
142
+ return coreWorkflowStatus<WorkflowMap>(_workflowName as string & keyof WorkflowMap) as PikkuFunctionConfig<
143
+ { runId: string },
144
+ { id: string; status: 'running' | 'completed' | 'failed' | 'cancelled'; output?: WorkflowMap[Name]['output']; error?: { message?: string } },
145
+ 'session' | 'rpc'
146
+ >
147
+ }
148
+
149
+ export const graphStart = <Name extends keyof GraphsMap, Node extends string & keyof GraphsMap[Name]>(
150
+ graphName: Name,
151
+ startNode: Node
152
+ ) => {
153
+ return coreGraphStart<GraphsMap>(graphName as string & keyof GraphsMap, startNode as string) as PikkuFunctionConfig<
154
+ GraphsMap[Name][Node] extends { input: infer I } ? I : never,
155
+ { runId: string },
156
+ 'session' | 'rpc'
157
+ >
158
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
4
+ import { pikkuState } from '@pikku/core/internal'
5
+ import type { SerializedWorkflowGraphs } from '@pikku/inspector/workflow-graph'
6
+
7
+ const workflowsMeta: SerializedWorkflowGraphs = {}
8
+
9
+ pikkuState('@pikku/addon-ollama', 'workflows', 'meta', workflowsMeta)
@@ -0,0 +1,3 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @pikku/addon-ollama
2
+
3
+ Local LLM inference via Ollama.
4
+
5
+ ## Functions
6
+
7
+ - `ollamaGenerateText` — generate text completions
8
+ - `ollamaGenerateObject` — generate structured JSON objects
9
+ - `ollamaEmbed` — generate an embedding for a single input
10
+ - `ollamaEmbedMany` — generate embeddings for multiple inputs
11
+
12
+ ## Secrets
13
+
14
+ No secrets required. Uses variable `OLLAMA_BASE_URL` (defaults to `http://localhost:11434/v1`).
15
+
16
+ ## Dependencies
17
+
18
+ - @ai-sdk/openai
19
+ - ai
@@ -0,0 +1,49 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
4
+ /**
5
+ * Addon package types for pikkuAddonConfig and pikkuAddonServices
6
+ */
7
+ import type { CreateConfig } from '@pikku/core';
8
+ import type { SingletonServices } from '../../types/application-types.d.js';
9
+ import type { Config } from '../../types/application-types.d.js';
10
+ import type { RequiredSingletonServices } from '../pikku-services.gen.js';
11
+ import { TypedSecretService } from '../secrets/pikku-secrets.gen.js';
12
+ import { TypedVariablesService } from '../variables/pikku-variables.gen.js';
13
+ /**
14
+ * Base services provided to addon package service factories.
15
+ * These are always available from the parent application.
16
+ */
17
+ export type AddonBaseServices = {
18
+ logger: SingletonServices['logger'];
19
+ variables: TypedVariablesService;
20
+ secrets: TypedSecretService;
21
+ };
22
+ /**
23
+ * Creates a Pikku config factory for addon packages.
24
+ * Unlike pikkuConfig, this receives AddonBaseServices (logger, variables, secrets)
25
+ * from the parent application, so addon packages can read variables/secrets during config creation.
26
+ */
27
+ export declare const pikkuAddonConfig: <ExistingServices extends Omit<Partial<SingletonServices>, "variables" | "secrets"> & AddonBaseServices>(func: (services: ExistingServices) => Promise<Config>) => CreateConfig<Config>;
28
+ /**
29
+ * Creates a Pikku singleton services factory for addon packages.
30
+ * Unlike pikkuServices, this expects the parent application to provide
31
+ * logger, variables, and secrets - no fallbacks needed.
32
+ *
33
+ * @param func - Addon services factory function that receives config and base services
34
+ * @returns The singleton services factory function
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * export const createSingletonServices = pikkuAddonServices(async (
39
+ * config,
40
+ * { secrets }
41
+ * ) => {
42
+ * const creds = await secrets.getSecretJSON<GithubCredentials>('GITHUB_CREDENTIALS')
43
+ * const github = new GithubService(creds)
44
+ * return { github }
45
+ * })
46
+ * ```
47
+ */
48
+ export declare const pikkuAddonServices: <T extends Record<string, any>, ExistingServices extends Omit<Partial<SingletonServices>, "variables" | "secrets"> & AddonBaseServices>(func: (config: Config, services: ExistingServices) => Promise<T>) => (config: Config, existingServices?: Partial<SingletonServices>) => Promise<RequiredSingletonServices>;
49
+ //# sourceMappingURL=pikku-addon-types.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-addon-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/addon/pikku-addon-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAK3E;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACnC,SAAS,EAAE,qBAAqB,CAAA;IAChC,OAAO,EAAE,kBAAkB,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACrI,MAAM,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,KACpD,YAAY,CAAC,MAAM,CAKrB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,SAAS,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,GAAG,iBAAiB,EACtK,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,MAElD,QAAQ,MAAM,EAAE,mBAAmB,OAAO,CAAC,iBAAiB,CAAC,KAAG,OAAO,CAAC,yBAAyB,CAahH,CAAA"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.1
3
+ */
4
+ /**
5
+ * Addon package types for pikkuAddonConfig and pikkuAddonServices
6
+ */
7
+ import { TypedSecretService } from '../secrets/pikku-secrets.gen.js';
8
+ import { TypedVariablesService } from '../variables/pikku-variables.gen.js';
9
+ /**
10
+ * Creates a Pikku config factory for addon packages.
11
+ * Unlike pikkuConfig, this receives AddonBaseServices (logger, variables, secrets)
12
+ * from the parent application, so addon packages can read variables/secrets during config creation.
13
+ */
14
+ export const pikkuAddonConfig = (func) => {
15
+ return (async (_variables, existingServices) => {
16
+ const { secrets, variables, ...rest } = (existingServices ?? {});
17
+ return func({ ...rest, secrets: new TypedSecretService(secrets), variables: new TypedVariablesService(variables) });
18
+ });
19
+ };
20
+ /**
21
+ * Creates a Pikku singleton services factory for addon packages.
22
+ * Unlike pikkuServices, this expects the parent application to provide
23
+ * logger, variables, and secrets - no fallbacks needed.
24
+ *
25
+ * @param func - Addon services factory function that receives config and base services
26
+ * @returns The singleton services factory function
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * export const createSingletonServices = pikkuAddonServices(async (
31
+ * config,
32
+ * { secrets }
33
+ * ) => {
34
+ * const creds = await secrets.getSecretJSON<GithubCredentials>('GITHUB_CREDENTIALS')
35
+ * const github = new GithubService(creds)
36
+ * return { github }
37
+ * })
38
+ * ```
39
+ */
40
+ export const pikkuAddonServices = (func) => {
41
+ return async (config, existingServices) => {
42
+ const { logger, variables, secrets } = (existingServices ?? {});
43
+ const typedVariables = new TypedVariablesService(variables);
44
+ const typedSecrets = new TypedSecretService(secrets);
45
+ const result = await func(config, { ...existingServices, logger, variables: typedVariables, secrets: typedSecrets });
46
+ return {
47
+ config,
48
+ logger,
49
+ variables: typedVariables,
50
+ secrets: typedSecrets,
51
+ ...result,
52
+ };
53
+ };
54
+ };
55
+ //# sourceMappingURL=pikku-addon-types.gen.js.map