@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.
- package/.pikku/addon/pikku-addon-types.gen.ts +105 -0
- package/.pikku/addon/pikku-package.gen.ts +11 -0
- package/.pikku/agent/pikku-agent-map.gen.d.ts +4 -0
- package/.pikku/agent/pikku-agent-types.gen.ts +82 -0
- package/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/.pikku/console/pikku-addon-meta.gen.json +58 -0
- package/.pikku/console/pikku-node-types.gen.ts +8 -0
- package/.pikku/function/pikku-function-types.gen.ts +754 -0
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +118 -0
- package/.pikku/function/pikku-functions-meta.gen.json +78 -0
- package/.pikku/function/pikku-functions-meta.gen.ts +7 -0
- package/.pikku/function/pikku-functions.gen.ts +14 -0
- package/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/.pikku/pikku-bootstrap.gen.ts +8 -0
- package/.pikku/pikku-meta-service.gen.ts +10 -0
- package/.pikku/pikku-services.gen.ts +45 -0
- package/.pikku/pikku-types.gen.ts +21 -0
- package/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +207 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +211 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +6 -0
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -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 +38 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +167 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +9 -0
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +3 -0
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +4 -4
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +7 -3
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +11 -6
- package/dist/.pikku/addon/pikku-package.gen.js +2 -1
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +3 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +2 -14
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +112 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js +60 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.js.map +1 -0
- package/dist/.pikku/channel/pikku-channel-types.gen.ts +177 -0
- package/dist/.pikku/console/pikku-addon-meta.gen.json +27 -27
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +71 -87
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +80 -60
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +170 -102
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +56 -44
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +42 -38
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +2 -2
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions.gen.ts +2 -2
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +120 -0
- package/dist/.pikku/http/pikku-http-types.gen.d.ts.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.js +72 -0
- package/dist/.pikku/http/pikku-http-types.gen.js.map +1 -0
- package/dist/.pikku/http/pikku-http-types.gen.ts +147 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +131 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +38 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js.map +1 -0
- package/dist/.pikku/mcp/pikku-mcp-types.gen.ts +183 -0
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -2
- package/dist/.pikku/pikku-bootstrap.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +2 -10
- package/dist/.pikku/pikku-bootstrap.gen.js.map +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.ts +2 -9
- package/dist/.pikku/pikku-meta-service.gen.d.ts +8 -0
- package/dist/.pikku/pikku-meta-service.gen.d.ts.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.js +10 -0
- package/dist/.pikku/pikku-meta-service.gen.js.map +1 -0
- package/dist/.pikku/pikku-meta-service.gen.ts +10 -0
- package/dist/.pikku/pikku-services.gen.d.ts +10 -2
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +9 -0
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +12 -2
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-types.gen.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +24 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js +17 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.js.map +1 -0
- package/dist/.pikku/queue/pikku-queue-types.gen.ts +27 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +81 -62
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +84 -65
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts +2 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.d.ts.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +7 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js.map +1 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +6 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +6 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +22 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +17 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js.map +1 -0
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.ts +25 -0
- package/dist/.pikku/schemas/register.gen.js +11 -11
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/register.gen.ts +17 -17
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +9 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +36 -27
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -18
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +66 -57
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/src/functions/text/generate-object.function.d.ts +4 -4
- package/package.json +7 -6
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts +0 -2
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +0 -5
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js.map +0 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import type { CorePikkuMiddleware, CorePermissionGroup, ListInput, ListOutput, PikkuWire, PickRequired } from '@pikku/core'
|
|
9
|
+
import type { CorePikkuFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission } from '@pikku/core/function'
|
|
10
|
+
import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function'
|
|
11
|
+
import {
|
|
12
|
+
addTagMiddleware as addTagMiddlewareCore,
|
|
13
|
+
addGlobalMiddleware as addGlobalMiddlewareCore,
|
|
14
|
+
addTagPermission as addTagPermissionCore,
|
|
15
|
+
addGlobalPermission as addGlobalPermissionCore,
|
|
16
|
+
} from '@pikku/core/middleware'
|
|
9
17
|
import { pikkuState as __pikkuState, CreateWireServices } from '@pikku/core/internal'
|
|
10
|
-
import { pikkuAuth as pikkuAuthCore } from '@pikku/core'
|
|
11
|
-
import { PikkuError } from '@pikku/core/errors'
|
|
12
18
|
import type { NodeType } from '@pikku/core/node'
|
|
13
19
|
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
14
20
|
import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
|
|
@@ -323,34 +329,36 @@ export type PikkuFunctionConfig<
|
|
|
323
329
|
* Use this when you want to define input/output schemas using Zod.
|
|
324
330
|
* Types are automatically inferred from the schemas.
|
|
325
331
|
*/
|
|
332
|
+
type SchemaInferred<S, Fallback = unknown> = S extends StandardSchemaV1
|
|
333
|
+
? InferSchemaOutput<S>
|
|
334
|
+
: Fallback
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Schema-overload variant for pikkuFunc. Derived from CorePikkuFunctionConfig
|
|
338
|
+
* so adding a field on the core type automatically propagates here.
|
|
339
|
+
*/
|
|
326
340
|
export type PikkuFunctionConfigWithSchema<
|
|
327
341
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
328
342
|
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
329
343
|
RequiredWires extends keyof PikkuWire = never
|
|
330
|
-
> =
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
|
|
341
|
-
RequiredWires
|
|
342
|
-
> | PikkuFunctionSessionless<
|
|
343
|
-
InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown,
|
|
344
|
-
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown,
|
|
345
|
-
RequiredWires
|
|
346
|
-
>
|
|
347
|
-
auth?: boolean
|
|
348
|
-
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
|
|
349
|
-
middleware?: PikkuMiddleware[]
|
|
344
|
+
> = Omit<
|
|
345
|
+
CorePikkuFunctionConfig<
|
|
346
|
+
| PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
|
347
|
+
| PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
|
348
|
+
>,
|
|
349
|
+
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
|
|
350
|
+
> & {
|
|
351
|
+
func:
|
|
352
|
+
| PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
|
353
|
+
| PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
|
350
354
|
input?: InputSchema
|
|
351
355
|
output?: OutputSchema
|
|
352
|
-
|
|
353
|
-
|
|
356
|
+
permissions?: InputSchema extends StandardSchemaV1
|
|
357
|
+
? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
|
358
|
+
: undefined
|
|
359
|
+
approvalDescription?: InputSchema extends StandardSchemaV1
|
|
360
|
+
? PikkuApprovalDescription<InferSchemaOutput<InputSchema>>
|
|
361
|
+
: never
|
|
354
362
|
}
|
|
355
363
|
|
|
356
364
|
/**
|
|
@@ -406,35 +414,62 @@ export function pikkuFunc(func: any) {
|
|
|
406
414
|
return typeof func === 'function' ? { func } : func
|
|
407
415
|
}
|
|
408
416
|
|
|
417
|
+
export type PikkuListFunction<
|
|
418
|
+
F extends Record<string, unknown> = {},
|
|
419
|
+
Row = unknown,
|
|
420
|
+
S extends string = never
|
|
421
|
+
> =
|
|
422
|
+
| PikkuFunction<ListInput<F, S>, ListOutput<Row>, 'session' | 'rpc'>
|
|
423
|
+
| PikkuFunctionSessionless<
|
|
424
|
+
ListInput<F, S>,
|
|
425
|
+
ListOutput<Row>,
|
|
426
|
+
'session' | 'rpc'
|
|
427
|
+
>
|
|
428
|
+
|
|
429
|
+
export const pikkuListFunc = <
|
|
430
|
+
F extends Record<string, unknown> = {},
|
|
431
|
+
Row = unknown,
|
|
432
|
+
S extends string = never
|
|
433
|
+
>(
|
|
434
|
+
config: PikkuFunctionConfig<
|
|
435
|
+
ListInput<F, S>,
|
|
436
|
+
ListOutput<Row>,
|
|
437
|
+
'session' | 'rpc'
|
|
438
|
+
>
|
|
439
|
+
): PikkuFunctionConfig<ListInput<F, S>, ListOutput<Row>, 'session' | 'rpc'> => {
|
|
440
|
+
return pikkuFunc(config)
|
|
441
|
+
}
|
|
442
|
+
|
|
409
443
|
/**
|
|
410
444
|
* Configuration object for sessionless Pikku functions with Zod schema validation.
|
|
411
445
|
*/
|
|
446
|
+
/**
|
|
447
|
+
* Schema-overload variant for pikkuSessionlessFunc. Derived from
|
|
448
|
+
* CorePikkuFunctionConfig to stay in sync with the generic-typed config.
|
|
449
|
+
*/
|
|
412
450
|
export type PikkuFunctionSessionlessConfigWithSchema<
|
|
413
451
|
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
414
452
|
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
415
453
|
RequiredWires extends keyof PikkuWire = never
|
|
416
|
-
> =
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
internal?: boolean
|
|
423
|
-
remote?: boolean
|
|
424
|
-
approvalRequired?: boolean
|
|
425
|
-
approvalDescription?: InputSchema extends StandardSchemaV1 ? PikkuApprovalDescription<InferSchemaOutput<InputSchema>> : never
|
|
454
|
+
> = Omit<
|
|
455
|
+
CorePikkuFunctionConfig<
|
|
456
|
+
PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
|
457
|
+
>,
|
|
458
|
+
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
|
|
459
|
+
> & {
|
|
426
460
|
func: PikkuFunctionSessionless<
|
|
427
|
-
|
|
428
|
-
|
|
461
|
+
SchemaInferred<InputSchema>,
|
|
462
|
+
SchemaInferred<OutputSchema>,
|
|
429
463
|
RequiredWires
|
|
430
464
|
>
|
|
431
|
-
auth?: boolean
|
|
432
|
-
permissions?: InputSchema extends StandardSchemaV1 ? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>> : undefined
|
|
433
|
-
middleware?: PikkuMiddleware[]
|
|
434
465
|
input?: InputSchema
|
|
435
466
|
output?: OutputSchema
|
|
436
|
-
|
|
437
|
-
|
|
467
|
+
permissions?: InputSchema extends StandardSchemaV1
|
|
468
|
+
? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
|
469
|
+
: undefined
|
|
470
|
+
approvalDescription?: InputSchema extends StandardSchemaV1
|
|
471
|
+
? PikkuApprovalDescription<InferSchemaOutput<InputSchema>>
|
|
472
|
+
: never
|
|
438
473
|
}
|
|
439
474
|
|
|
440
475
|
/**
|
|
@@ -512,27 +547,23 @@ export const pikkuVoidFunc = (
|
|
|
512
547
|
}
|
|
513
548
|
|
|
514
549
|
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
* without type compatibility issues.
|
|
550
|
+
* References a registered function by name for use in any wiring.
|
|
551
|
+
* Works for both local and addon functions — resolves via RPC at runtime.
|
|
518
552
|
*
|
|
519
|
-
* @template Name - The
|
|
520
|
-
* @param rpcName - The name of the
|
|
521
|
-
* @returns A Pikku function that proxies calls
|
|
553
|
+
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
|
554
|
+
* @param rpcName - The name of the function to reference
|
|
555
|
+
* @returns A Pikku function config that proxies calls via RPC
|
|
522
556
|
*
|
|
523
557
|
* @example
|
|
524
558
|
* ```typescript
|
|
525
|
-
* //
|
|
526
|
-
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
* func: addon('ext:hello'),
|
|
531
|
-
* tags: ['addon'],
|
|
532
|
-
* })
|
|
559
|
+
* // Use in agent tools
|
|
560
|
+
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
|
561
|
+
*
|
|
562
|
+
* // Use in HTTP wiring
|
|
563
|
+
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
|
533
564
|
* ```
|
|
534
565
|
*/
|
|
535
|
-
export const
|
|
566
|
+
export const ref = <Name extends keyof FlattenedRPCMap>(
|
|
536
567
|
rpcName: Name
|
|
537
568
|
): PikkuFunctionConfig<
|
|
538
569
|
FlattenedRPCMap[Name]['input'],
|
|
@@ -591,12 +622,27 @@ export const pikkuConfig = (
|
|
|
591
622
|
* ```
|
|
592
623
|
*/
|
|
593
624
|
export const pikkuServices = (
|
|
594
|
-
func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<RequiredSingletonServices
|
|
625
|
+
func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<Partial<Omit<RequiredSingletonServices, 'auth'>>>
|
|
595
626
|
) => {
|
|
596
627
|
return async (config: Config, existingServices: Partial<SingletonServices> = {}) => {
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
|
|
628
|
+
const createdServices = await func(config, existingServices)
|
|
629
|
+
const services = { ...existingServices, ...createdServices }
|
|
630
|
+
const authFactory = __pikkuState(null, 'package', 'authFactory')
|
|
631
|
+
if (authFactory) {
|
|
632
|
+
let authInstance: Promise<unknown> | undefined
|
|
633
|
+
;(services as any).auth = () => {
|
|
634
|
+
authInstance ??= Promise.resolve()
|
|
635
|
+
.then(() => authFactory(services as any))
|
|
636
|
+
.catch((error) => {
|
|
637
|
+
authInstance = undefined
|
|
638
|
+
throw error
|
|
639
|
+
})
|
|
640
|
+
return authInstance
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
const resolved = services as RequiredSingletonServices
|
|
644
|
+
__pikkuState(null, 'package', 'singletonServices', resolved as any)
|
|
645
|
+
return resolved
|
|
600
646
|
}
|
|
601
647
|
}
|
|
602
648
|
|
|
@@ -629,58 +675,80 @@ export const pikkuWireServices = (
|
|
|
629
675
|
}
|
|
630
676
|
|
|
631
677
|
/**
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
* This function allows you to register middleware that will be applied to
|
|
635
|
-
* any wiring (HTTP, Channel, Queue, Scheduler, MCP) that includes the matching tag.
|
|
636
|
-
*
|
|
637
|
-
* @param tag - The tag that the middleware should apply to.
|
|
638
|
-
* @param middleware - The middleware array to apply for the specified tag.
|
|
639
|
-
*
|
|
640
|
-
* @throws Error if middleware for the tag already exists.
|
|
678
|
+
* Tag-scoped middleware. Applies to any wiring that carries the matching tag.
|
|
641
679
|
*
|
|
642
680
|
* @example
|
|
643
|
-
*
|
|
644
|
-
* // Add admin middleware for admin endpoints
|
|
645
|
-
* addMiddleware('admin', [adminMiddleware])
|
|
646
|
-
*
|
|
647
|
-
* // Add authentication middleware for auth endpoints
|
|
648
|
-
* addMiddleware('auth', [authMiddleware])
|
|
649
|
-
*
|
|
650
|
-
* // Add logging middleware for all API endpoints
|
|
651
|
-
* addMiddleware('api', [loggingMiddleware])
|
|
652
|
-
* ```
|
|
681
|
+
* addTagMiddleware('admin', [adminMiddleware])
|
|
653
682
|
*/
|
|
654
|
-
export const
|
|
655
|
-
|
|
683
|
+
export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) => {
|
|
684
|
+
addTagMiddlewareCore(tag, middleware as any, '@pikku/addon-ollama')
|
|
656
685
|
}
|
|
657
686
|
|
|
658
687
|
/**
|
|
659
|
-
*
|
|
688
|
+
* Wire-agnostic global middleware. Runs at the top of every wiring's
|
|
689
|
+
* middleware chain — before wire-, tag-, and function-level entries.
|
|
660
690
|
*
|
|
661
|
-
*
|
|
662
|
-
* any wiring (HTTP, Channel, Queue, Scheduler, MCP) that includes the matching tag.
|
|
691
|
+
* Resolution order: global -> wire -> tag -> function.
|
|
663
692
|
*
|
|
664
|
-
* @
|
|
665
|
-
*
|
|
666
|
-
|
|
667
|
-
|
|
693
|
+
* @example
|
|
694
|
+
* addGlobalMiddleware([telemetryMiddleware])
|
|
695
|
+
*/
|
|
696
|
+
export const addGlobalMiddleware = (middleware: PikkuMiddleware[]) => {
|
|
697
|
+
addGlobalMiddlewareCore(middleware as any, '@pikku/addon-ollama')
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Tag-scoped permissions. Applies to any wiring that carries the matching tag.
|
|
668
702
|
*
|
|
669
703
|
* @example
|
|
670
|
-
*
|
|
671
|
-
|
|
672
|
-
|
|
704
|
+
* addTagPermission('admin', [adminPermission])
|
|
705
|
+
*/
|
|
706
|
+
export const addTagPermission = <In = unknown>(tag: string, permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
|
|
707
|
+
addTagPermissionCore(tag, permissions as any, '@pikku/addon-ollama')
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Wire-agnostic global permissions. Runs at the top of every wiring's
|
|
712
|
+
* permission resolution — before wire-, tag-, and function-level entries.
|
|
673
713
|
*
|
|
674
|
-
*
|
|
675
|
-
* addPermission('auth', [authPermission])
|
|
714
|
+
* Resolution order: global -> wire -> tag -> function.
|
|
676
715
|
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
* ```
|
|
716
|
+
* @example
|
|
717
|
+
* addGlobalPermission([signedInUser])
|
|
680
718
|
*/
|
|
681
|
-
export const
|
|
682
|
-
|
|
719
|
+
export const addGlobalPermission = <In = unknown>(permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
|
|
720
|
+
addGlobalPermissionCore(permissions as any, '@pikku/addon-ollama')
|
|
683
721
|
}
|
|
684
722
|
|
|
685
|
-
export { wireAddon } from '@pikku/core'
|
|
686
|
-
export type { WireAddonConfig } from '@pikku/core'
|
|
723
|
+
export { wireAddon } from '@pikku/core/rpc'
|
|
724
|
+
export type { WireAddonConfig } from '@pikku/core/rpc'
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Addon contract references. Generated from each wired addon's published
|
|
729
|
+
* contract metadata — no addon source is imported. Functions are proxied via
|
|
730
|
+
* ref() (RPC) exactly like ref('namespace:fn').
|
|
731
|
+
*/
|
|
732
|
+
const __addonHttp = {} as const
|
|
733
|
+
const __addonChannel = {} as const
|
|
734
|
+
const __addonCli = {} as const
|
|
735
|
+
|
|
736
|
+
export const refHTTP = <Name extends keyof typeof __addonHttp>(
|
|
737
|
+
name: Name,
|
|
738
|
+
options?: { basePath?: string }
|
|
739
|
+
): (typeof __addonHttp)[Name] => {
|
|
740
|
+
const contract = __addonHttp[name] as any
|
|
741
|
+
return (
|
|
742
|
+
options?.basePath !== undefined
|
|
743
|
+
? { ...contract, basePath: options.basePath }
|
|
744
|
+
: contract
|
|
745
|
+
) as (typeof __addonHttp)[Name]
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export const refChannel = <Name extends keyof typeof __addonChannel>(
|
|
749
|
+
name: Name
|
|
750
|
+
): (typeof __addonChannel)[Name] => __addonChannel[name]
|
|
751
|
+
|
|
752
|
+
export const refCLI = <Name extends keyof typeof __addonCli>(
|
|
753
|
+
name: Name
|
|
754
|
+
): (typeof __addonCli)[Name] => __addonCli[name]
|
|
@@ -1,106 +1,118 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"pikkuFuncId": "
|
|
2
|
+
"ollamaEmbedMany": {
|
|
3
|
+
"pikkuFuncId": "ollamaEmbedMany",
|
|
4
4
|
"functionType": "user",
|
|
5
5
|
"funcWrapper": "pikkuSessionlessFunc",
|
|
6
6
|
"sessionless": true,
|
|
7
|
-
"name": "
|
|
7
|
+
"name": "ollamaEmbedMany",
|
|
8
8
|
"services": {
|
|
9
9
|
"optimized": true,
|
|
10
10
|
"services": [
|
|
11
11
|
"ollama"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
|
-
"inputSchemaName": "
|
|
15
|
-
"outputSchemaName": "
|
|
14
|
+
"inputSchemaName": "OllamaEmbedManyInput",
|
|
15
|
+
"outputSchemaName": "OllamaEmbedManyOutput",
|
|
16
16
|
"inputs": [
|
|
17
|
-
"
|
|
17
|
+
"OllamaEmbedManyInput"
|
|
18
18
|
],
|
|
19
19
|
"outputs": [
|
|
20
|
-
"
|
|
20
|
+
"OllamaEmbedManyOutput"
|
|
21
21
|
],
|
|
22
|
-
"
|
|
22
|
+
"implementationHash": "2abe1562dff3ca44",
|
|
23
|
+
"description": "Create embedding vectors from multiple texts using an Ollama model",
|
|
23
24
|
"isDirectFunction": false,
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"sourceFile": "/home/runner/work/addons/addons/packages/ai/ollama/src/functions/embeddings/embed-many.function.ts",
|
|
26
|
+
"exportedName": "ollamaEmbedMany",
|
|
27
|
+
"contractHash": "3db02092482ca9c6",
|
|
28
|
+
"inputHash": "4f6f4b67",
|
|
29
|
+
"outputHash": "54a0cfe3"
|
|
27
30
|
},
|
|
28
|
-
"
|
|
29
|
-
"pikkuFuncId": "
|
|
31
|
+
"ollamaEmbed": {
|
|
32
|
+
"pikkuFuncId": "ollamaEmbed",
|
|
30
33
|
"functionType": "user",
|
|
31
34
|
"funcWrapper": "pikkuSessionlessFunc",
|
|
32
35
|
"sessionless": true,
|
|
33
|
-
"name": "
|
|
36
|
+
"name": "ollamaEmbed",
|
|
34
37
|
"services": {
|
|
35
38
|
"optimized": true,
|
|
36
39
|
"services": [
|
|
37
40
|
"ollama"
|
|
38
41
|
]
|
|
39
42
|
},
|
|
40
|
-
"inputSchemaName": "
|
|
41
|
-
"outputSchemaName": "
|
|
43
|
+
"inputSchemaName": "OllamaEmbedInput",
|
|
44
|
+
"outputSchemaName": "OllamaEmbedOutput",
|
|
42
45
|
"inputs": [
|
|
43
|
-
"
|
|
46
|
+
"OllamaEmbedInput"
|
|
44
47
|
],
|
|
45
48
|
"outputs": [
|
|
46
|
-
"
|
|
49
|
+
"OllamaEmbedOutput"
|
|
47
50
|
],
|
|
48
|
-
"
|
|
51
|
+
"implementationHash": "ac6fc8ad50940ac6",
|
|
52
|
+
"description": "Create an embedding vector from text using an Ollama model",
|
|
49
53
|
"isDirectFunction": false,
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
54
|
+
"sourceFile": "/home/runner/work/addons/addons/packages/ai/ollama/src/functions/embeddings/embed.function.ts",
|
|
55
|
+
"exportedName": "ollamaEmbed",
|
|
56
|
+
"contractHash": "0354ea934b747af7",
|
|
57
|
+
"inputHash": "8340c2c0",
|
|
58
|
+
"outputHash": "bb88b854"
|
|
53
59
|
},
|
|
54
|
-
"
|
|
55
|
-
"pikkuFuncId": "
|
|
60
|
+
"ollamaGenerateObject": {
|
|
61
|
+
"pikkuFuncId": "ollamaGenerateObject",
|
|
56
62
|
"functionType": "user",
|
|
57
63
|
"funcWrapper": "pikkuSessionlessFunc",
|
|
58
64
|
"sessionless": true,
|
|
59
|
-
"name": "
|
|
65
|
+
"name": "ollamaGenerateObject",
|
|
60
66
|
"services": {
|
|
61
67
|
"optimized": true,
|
|
62
68
|
"services": [
|
|
63
69
|
"ollama"
|
|
64
70
|
]
|
|
65
71
|
},
|
|
66
|
-
"inputSchemaName": "
|
|
67
|
-
"outputSchemaName": "
|
|
72
|
+
"inputSchemaName": "OllamaGenerateObjectInput",
|
|
73
|
+
"outputSchemaName": "OllamaGenerateObjectOutput",
|
|
68
74
|
"inputs": [
|
|
69
|
-
"
|
|
75
|
+
"OllamaGenerateObjectInput"
|
|
70
76
|
],
|
|
71
77
|
"outputs": [
|
|
72
|
-
"
|
|
78
|
+
"OllamaGenerateObjectOutput"
|
|
73
79
|
],
|
|
74
|
-
"
|
|
80
|
+
"implementationHash": "267ece83350ede19",
|
|
81
|
+
"description": "Generate a structured JSON object using an Ollama model",
|
|
75
82
|
"isDirectFunction": false,
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
83
|
+
"sourceFile": "/home/runner/work/addons/addons/packages/ai/ollama/src/functions/text/generate-object.function.ts",
|
|
84
|
+
"exportedName": "ollamaGenerateObject",
|
|
85
|
+
"contractHash": "e7026856e15a96b5",
|
|
86
|
+
"inputHash": "4ceb54b7",
|
|
87
|
+
"outputHash": "e26f98ba"
|
|
79
88
|
},
|
|
80
|
-
"
|
|
81
|
-
"pikkuFuncId": "
|
|
89
|
+
"ollamaGenerateText": {
|
|
90
|
+
"pikkuFuncId": "ollamaGenerateText",
|
|
82
91
|
"functionType": "user",
|
|
83
92
|
"funcWrapper": "pikkuSessionlessFunc",
|
|
84
93
|
"sessionless": true,
|
|
85
|
-
"name": "
|
|
94
|
+
"name": "ollamaGenerateText",
|
|
86
95
|
"services": {
|
|
87
96
|
"optimized": true,
|
|
88
97
|
"services": [
|
|
89
98
|
"ollama"
|
|
90
99
|
]
|
|
91
100
|
},
|
|
92
|
-
"inputSchemaName": "
|
|
93
|
-
"outputSchemaName": "
|
|
101
|
+
"inputSchemaName": "OllamaGenerateTextInput",
|
|
102
|
+
"outputSchemaName": "OllamaGenerateTextOutput",
|
|
94
103
|
"inputs": [
|
|
95
|
-
"
|
|
104
|
+
"OllamaGenerateTextInput"
|
|
96
105
|
],
|
|
97
106
|
"outputs": [
|
|
98
|
-
"
|
|
107
|
+
"OllamaGenerateTextOutput"
|
|
99
108
|
],
|
|
100
|
-
"
|
|
109
|
+
"implementationHash": "24061cbafdbafa6a",
|
|
110
|
+
"description": "Generate text using an Ollama model",
|
|
101
111
|
"isDirectFunction": false,
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
112
|
+
"sourceFile": "/home/runner/work/addons/addons/packages/ai/ollama/src/functions/text/generate.function.ts",
|
|
113
|
+
"exportedName": "ollamaGenerateText",
|
|
114
|
+
"contractHash": "0d03988593f9adef",
|
|
115
|
+
"inputHash": "bdf047a6",
|
|
116
|
+
"outputHash": "4e2c22b3"
|
|
105
117
|
}
|
|
106
118
|
}
|
|
@@ -1,39 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"pikkuFuncId": "
|
|
4
|
-
"functionType": "user",
|
|
5
|
-
"funcWrapper": "pikkuSessionlessFunc",
|
|
6
|
-
"sessionless": true,
|
|
7
|
-
"name": "ollamaGenerateText",
|
|
8
|
-
"inputSchemaName": "OllamaGenerateTextInput",
|
|
9
|
-
"outputSchemaName": "OllamaGenerateTextOutput",
|
|
10
|
-
"inputs": [
|
|
11
|
-
"OllamaGenerateTextInput"
|
|
12
|
-
],
|
|
13
|
-
"outputs": [
|
|
14
|
-
"OllamaGenerateTextOutput"
|
|
15
|
-
],
|
|
16
|
-
"contractHash": "0d03988593f9adef",
|
|
17
|
-
"inputHash": "bdf047a6",
|
|
18
|
-
"outputHash": "4e2c22b3"
|
|
19
|
-
},
|
|
20
|
-
"ollamaGenerateObject": {
|
|
21
|
-
"pikkuFuncId": "ollamaGenerateObject",
|
|
2
|
+
"ollamaEmbedMany": {
|
|
3
|
+
"pikkuFuncId": "ollamaEmbedMany",
|
|
22
4
|
"functionType": "user",
|
|
23
5
|
"funcWrapper": "pikkuSessionlessFunc",
|
|
24
6
|
"sessionless": true,
|
|
25
|
-
"name": "
|
|
26
|
-
"inputSchemaName": "
|
|
27
|
-
"outputSchemaName": "
|
|
7
|
+
"name": "ollamaEmbedMany",
|
|
8
|
+
"inputSchemaName": "OllamaEmbedManyInput",
|
|
9
|
+
"outputSchemaName": "OllamaEmbedManyOutput",
|
|
28
10
|
"inputs": [
|
|
29
|
-
"
|
|
11
|
+
"OllamaEmbedManyInput"
|
|
30
12
|
],
|
|
31
13
|
"outputs": [
|
|
32
|
-
"
|
|
14
|
+
"OllamaEmbedManyOutput"
|
|
33
15
|
],
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
16
|
+
"implementationHash": "2abe1562dff3ca44",
|
|
17
|
+
"contractHash": "3db02092482ca9c6",
|
|
18
|
+
"inputHash": "4f6f4b67",
|
|
19
|
+
"outputHash": "54a0cfe3"
|
|
37
20
|
},
|
|
38
21
|
"ollamaEmbed": {
|
|
39
22
|
"pikkuFuncId": "ollamaEmbed",
|
|
@@ -49,26 +32,47 @@
|
|
|
49
32
|
"outputs": [
|
|
50
33
|
"OllamaEmbedOutput"
|
|
51
34
|
],
|
|
35
|
+
"implementationHash": "ac6fc8ad50940ac6",
|
|
52
36
|
"contractHash": "0354ea934b747af7",
|
|
53
37
|
"inputHash": "8340c2c0",
|
|
54
38
|
"outputHash": "bb88b854"
|
|
55
39
|
},
|
|
56
|
-
"
|
|
57
|
-
"pikkuFuncId": "
|
|
40
|
+
"ollamaGenerateObject": {
|
|
41
|
+
"pikkuFuncId": "ollamaGenerateObject",
|
|
58
42
|
"functionType": "user",
|
|
59
43
|
"funcWrapper": "pikkuSessionlessFunc",
|
|
60
44
|
"sessionless": true,
|
|
61
|
-
"name": "
|
|
62
|
-
"inputSchemaName": "
|
|
63
|
-
"outputSchemaName": "
|
|
45
|
+
"name": "ollamaGenerateObject",
|
|
46
|
+
"inputSchemaName": "OllamaGenerateObjectInput",
|
|
47
|
+
"outputSchemaName": "OllamaGenerateObjectOutput",
|
|
64
48
|
"inputs": [
|
|
65
|
-
"
|
|
49
|
+
"OllamaGenerateObjectInput"
|
|
66
50
|
],
|
|
67
51
|
"outputs": [
|
|
68
|
-
"
|
|
52
|
+
"OllamaGenerateObjectOutput"
|
|
69
53
|
],
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
54
|
+
"implementationHash": "267ece83350ede19",
|
|
55
|
+
"contractHash": "e7026856e15a96b5",
|
|
56
|
+
"inputHash": "4ceb54b7",
|
|
57
|
+
"outputHash": "e26f98ba"
|
|
58
|
+
},
|
|
59
|
+
"ollamaGenerateText": {
|
|
60
|
+
"pikkuFuncId": "ollamaGenerateText",
|
|
61
|
+
"functionType": "user",
|
|
62
|
+
"funcWrapper": "pikkuSessionlessFunc",
|
|
63
|
+
"sessionless": true,
|
|
64
|
+
"name": "ollamaGenerateText",
|
|
65
|
+
"inputSchemaName": "OllamaGenerateTextInput",
|
|
66
|
+
"outputSchemaName": "OllamaGenerateTextOutput",
|
|
67
|
+
"inputs": [
|
|
68
|
+
"OllamaGenerateTextInput"
|
|
69
|
+
],
|
|
70
|
+
"outputs": [
|
|
71
|
+
"OllamaGenerateTextOutput"
|
|
72
|
+
],
|
|
73
|
+
"implementationHash": "24061cbafdbafa6a",
|
|
74
|
+
"contractHash": "0d03988593f9adef",
|
|
75
|
+
"inputHash": "bdf047a6",
|
|
76
|
+
"outputHash": "4e2c22b3"
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.55
|
|
3
3
|
*/
|
|
4
4
|
/* Import and register functions used by RPCs */
|
|
5
|
-
import { addFunction } from '@pikku/core';
|
|
5
|
+
import { addFunction } from '@pikku/core/function';
|
|
6
6
|
import { ollamaEmbed } from '../../src/functions/embeddings/embed.function.js';
|
|
7
7
|
import { ollamaEmbedMany } from '../../src/functions/embeddings/embed-many.function.js';
|
|
8
8
|
import { ollamaGenerateObject } from '../../src/functions/text/generate-object.function.js';
|