chore: server-and-serverless template
This commit is contained in:
754
packages/functions/.pikku/function/pikku-function-types.gen.ts
Normal file
754
packages/functions/.pikku/function/pikku-function-types.gen.ts
Normal file
@@ -0,0 +1,754 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.54
|
||||
*/
|
||||
/**
|
||||
* Core function, middleware, and permission types for all wirings
|
||||
*/
|
||||
|
||||
import type { CorePikkuMiddleware, CorePermissionGroup, ListInput, ListOutput, PikkuWire, PickRequired } from '@pikku/core'
|
||||
import type { CorePikkuFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission } from '@pikku/core/function'
|
||||
import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function'
|
||||
import {
|
||||
addTagMiddleware as addTagMiddlewareCore,
|
||||
addGlobalMiddleware as addGlobalMiddlewareCore,
|
||||
addTagPermission as addTagPermissionCore,
|
||||
addGlobalPermission as addGlobalPermissionCore,
|
||||
} from '@pikku/core/middleware'
|
||||
import { pikkuState as __pikkuState, CreateWireServices } from '@pikku/core/internal'
|
||||
import type { NodeType } from '@pikku/core/node'
|
||||
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
||||
import { CorePikkuFunction, CorePikkuFunctionSessionless } from '@pikku/core/function'
|
||||
|
||||
import type { UserSession } from '../../src/application-types.d.js'
|
||||
import type { SingletonServices } from '../../src/application-types.d.js'
|
||||
import type { Services } from '../../src/application-types.d.js'
|
||||
import type { Config } from '../../src/application-types.d.js'
|
||||
import type { TypedPikkuRPC, FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
||||
import type { RequiredSingletonServices, RequiredWireServices } from '../pikku-services.gen.js'
|
||||
import type { TypedWorkflow } from '../workflow/pikku-workflow-types.gen.js'
|
||||
|
||||
export type { SingletonServices as SingletonServices }
|
||||
export type { Services as Services }
|
||||
export type Session = UserSession
|
||||
|
||||
|
||||
/**
|
||||
* Inline node configuration for function definitions.
|
||||
*/
|
||||
export type NodeConfig = {
|
||||
displayName: string
|
||||
category: string
|
||||
type: NodeType
|
||||
errorOutput?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Type-safe API permission definition that integrates with your application's session type.
|
||||
* Use this to define authorization logic for your API endpoints.
|
||||
*
|
||||
* @template In - The input type that the permission check will receive
|
||||
* @template RequiredServices - The services required for this permission check
|
||||
*/
|
||||
export type PikkuPermission<In = unknown, RequiredServices extends Services = Services> = CorePikkuPermission<In, RequiredServices, PikkuWire<In, never, false, Session>>
|
||||
|
||||
/**
|
||||
* Type-safe middleware definition that can access your application's services and session.
|
||||
* Use this to define reusable middleware that can be applied to multiple wirings.
|
||||
*
|
||||
* @template RequiredServices - The services required for this middleware
|
||||
*/
|
||||
export type PikkuMiddleware<RequiredServices extends SingletonServices = SingletonServices> = CorePikkuMiddleware<RequiredServices>
|
||||
|
||||
/**
|
||||
* Configuration object for creating a permission with metadata
|
||||
*/
|
||||
export type PikkuPermissionConfig<In = unknown, RequiredServices extends Services = Services> = {
|
||||
/** The permission function */
|
||||
func: PikkuPermission<In, RequiredServices>
|
||||
/** Optional human-readable name for the permission */
|
||||
name?: string
|
||||
/** Optional description of what the permission checks */
|
||||
description?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory function for creating permissions with tree-shaking support.
|
||||
* Supports both direct function and configuration object syntax.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Direct function syntax
|
||||
* const permission = pikkuPermission(async ({ logger }, data, { session }) => {
|
||||
* const session = await session?.get()
|
||||
* return session?.role === 'admin'
|
||||
* })
|
||||
*
|
||||
* // Configuration object syntax with metadata
|
||||
* const adminPermission = pikkuPermission({
|
||||
* name: 'Admin Permission',
|
||||
* description: 'Checks if user has admin role',
|
||||
* func: async ({ logger }, data, { session }) => {
|
||||
* const session = await session?.get()
|
||||
* return session?.role === 'admin'
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuPermission = <In>(
|
||||
permission: PikkuPermission<In> | PikkuPermissionConfig<In>
|
||||
): PikkuPermission<In> => {
|
||||
return typeof permission === 'function' ? permission : permission.func
|
||||
}
|
||||
|
||||
/**
|
||||
* Type-safe auth-only permission that only needs services and session.
|
||||
* Use this for upfront authorization gates (MCP tools, AI agents, workflows)
|
||||
* where request data isn't available yet.
|
||||
*
|
||||
* @template RequiredServices - The services required for this auth check
|
||||
*/
|
||||
export type PikkuAuth<RequiredServices extends SingletonServices = SingletonServices> = CorePikkuAuth<RequiredServices, Session>
|
||||
|
||||
/**
|
||||
* Configuration object for creating an auth permission with metadata
|
||||
*/
|
||||
export type PikkuAuthConfig<RequiredServices extends SingletonServices = SingletonServices> = CorePikkuAuthConfig<RequiredServices, Session>
|
||||
|
||||
/**
|
||||
* Factory function for creating auth-only permissions with tree-shaking support.
|
||||
* Auth permissions only receive services and session (no request data),
|
||||
* making them evaluable before request data is available.
|
||||
*
|
||||
* @example
|
||||
* \`\`\`typescript
|
||||
* const isAuthenticated = pikkuAuth(async ({ logger }, session) => {
|
||||
* return !!session
|
||||
* })
|
||||
*
|
||||
* const isAdmin = pikkuAuth({
|
||||
* name: 'Admin Auth',
|
||||
* description: 'Checks if user is an admin',
|
||||
* func: async ({ logger }, session) => {
|
||||
* return session?.role === 'admin'
|
||||
* }
|
||||
* })
|
||||
* \`\`\`
|
||||
*/
|
||||
export const pikkuAuth = <RequiredServices extends SingletonServices = SingletonServices>(
|
||||
auth: PikkuAuth<RequiredServices> | PikkuAuthConfig<RequiredServices>
|
||||
): PikkuPermission<any, any> => {
|
||||
return pikkuAuthCore(auth as any) as any
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration object for creating middleware with metadata
|
||||
*/
|
||||
export type PikkuMiddlewareConfig<RequiredServices extends SingletonServices = SingletonServices> = {
|
||||
/** The middleware function */
|
||||
func: PikkuMiddleware<RequiredServices>
|
||||
/** Optional human-readable name for the middleware */
|
||||
name?: string
|
||||
/** Optional description of what the middleware does */
|
||||
description?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory function for creating middleware with tree-shaking support.
|
||||
* Supports both direct function and configuration object syntax.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Direct function syntax
|
||||
* const middleware = pikkuMiddleware(({ logger }, wires, next) => {
|
||||
* logger.info('Middleware executed')
|
||||
* await next()
|
||||
* })
|
||||
*
|
||||
* // Configuration object syntax with metadata
|
||||
* const logMiddleware = pikkuMiddleware({
|
||||
* name: 'Request Logger',
|
||||
* description: 'Logs all incoming requests',
|
||||
* func: async ({ logger }, wires, next) => {
|
||||
* logger.info('Request started')
|
||||
* await next()
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuMiddleware = <RequiredServices extends SingletonServices = SingletonServices>(
|
||||
middleware: PikkuMiddleware<RequiredServices> | PikkuMiddlewareConfig<RequiredServices>
|
||||
): PikkuMiddleware<RequiredServices> => {
|
||||
return typeof middleware === 'function' ? middleware : middleware.func
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory function for creating middleware factories
|
||||
* Use this when your middleware needs configuration/input parameters
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* export const logMiddleware = pikkuMiddlewareFactory<LogOptions>(({
|
||||
* message,
|
||||
* level = 'info'
|
||||
* }) => {
|
||||
* return pikkuMiddleware(async ({ logger }, next) => {
|
||||
* logger[level](message)
|
||||
* await next()
|
||||
* })
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuMiddlewareFactory = <In = any>(
|
||||
factory: (input: In) => PikkuMiddleware
|
||||
): ((input: In) => PikkuMiddleware) => {
|
||||
return factory
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory function for creating permission factories
|
||||
* Use this when your permission needs configuration/input parameters
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* export const requireRole = pikkuPermissionFactory<{ role: string }>(({
|
||||
* role
|
||||
* }) => {
|
||||
* return pikkuPermission(async ({ logger }, data, { session }) => {
|
||||
* if (!session || session.role !== role) {
|
||||
* logger.warn(`Permission denied: required role '${role}'`)
|
||||
* return false
|
||||
* }
|
||||
* return true
|
||||
* })
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuPermissionFactory = <In = any>(
|
||||
factory: (input: In) => PikkuPermission<any>
|
||||
): ((input: In) => PikkuPermission<any>) => {
|
||||
return factory
|
||||
}
|
||||
|
||||
/**
|
||||
* A function that generates a human-readable description of a pending approval action.
|
||||
* Used by AI agents to show meaningful approval prompts instead of raw tool arguments.
|
||||
*
|
||||
* @template In - The input type (same as the function it describes)
|
||||
* @template RequiredServices - The services required for this description function
|
||||
*/
|
||||
export type PikkuApprovalDescription<In = unknown, RequiredServices extends Services = Services> = (
|
||||
services: RequiredServices,
|
||||
data: In
|
||||
) => Promise<string>
|
||||
|
||||
/**
|
||||
* Factory function for creating approval description functions with tree-shaking support.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* export const deleteTodoApproval = pikkuApprovalDescription(
|
||||
* async ({ todoStore }, { id }) => {
|
||||
* const todo = await todoStore.get(id)
|
||||
* return \`Delete todo: "${todo.title}"\`
|
||||
* }
|
||||
* )
|
||||
* ```
|
||||
*/
|
||||
export const pikkuApprovalDescription = <In = unknown, RequiredServices extends Services = Services>(
|
||||
fn: PikkuApprovalDescription<In, RequiredServices>
|
||||
): PikkuApprovalDescription<In, RequiredServices> => {
|
||||
return fn
|
||||
}
|
||||
|
||||
/**
|
||||
* A sessionless API function that doesn't require user authentication.
|
||||
* Use this for public endpoints, health checks, or operations that don't need user context.
|
||||
*
|
||||
* @template In - The input type
|
||||
* @template Out - The output type that the function returns
|
||||
* @template RequiredServices - Services required by this function
|
||||
*/
|
||||
export type PikkuFunctionSessionless<
|
||||
In = unknown,
|
||||
Out = never,
|
||||
RequiredWires extends keyof PikkuWire = never,
|
||||
RequiredServices extends Services = Services
|
||||
> = CorePikkuFunctionSessionless<
|
||||
In,
|
||||
Out,
|
||||
RequiredServices,
|
||||
Session,
|
||||
PickRequired<PikkuWire<In, Out, false, Session, TypedPikkuRPC, null, any, TypedWorkflow>, RequiredWires>
|
||||
>
|
||||
|
||||
/**
|
||||
* A session-aware API function that requires user authentication.
|
||||
* Use this for protected endpoints that need access to user session data.
|
||||
*
|
||||
* @template In - The input type
|
||||
* @template Out - The output type that the function returns
|
||||
* @template RequiredServices - Services required by this function
|
||||
*/
|
||||
export type PikkuFunction<
|
||||
In = unknown,
|
||||
Out = never,
|
||||
RequiredWires extends keyof PikkuWire = 'session',
|
||||
RequiredServices extends Services = Services
|
||||
> = CorePikkuFunction<
|
||||
In,
|
||||
Out,
|
||||
RequiredServices,
|
||||
Session,
|
||||
PickRequired<PikkuWire<In, Out, true, Session, TypedPikkuRPC, null, any, TypedWorkflow>, RequiredWires>
|
||||
>
|
||||
|
||||
/**
|
||||
* Helper type to infer the output type from a Standard Schema
|
||||
*/
|
||||
export type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never
|
||||
|
||||
/**
|
||||
* Configuration object for Pikku functions with optional middleware, permissions, tags, and documentation.
|
||||
* This type wraps CorePikkuFunctionConfig with the user's custom types.
|
||||
*
|
||||
* @template In - The input type
|
||||
* @template Out - The output type
|
||||
* @template PikkuFunc - The function type (can be narrowed to PikkuFunction or PikkuFunctionSessionless)
|
||||
*/
|
||||
export type PikkuFunctionConfig<
|
||||
In = unknown,
|
||||
Out = unknown,
|
||||
RequiredWires extends keyof PikkuWire = never,
|
||||
PikkuFunc extends PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires> = PikkuFunction<In, Out, RequiredWires> | PikkuFunctionSessionless<In, Out, RequiredWires>,
|
||||
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
||||
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
||||
> = CorePikkuFunctionConfig<PikkuFunc, PikkuPermission<In>, PikkuMiddleware, InputSchema, OutputSchema>
|
||||
|
||||
/**
|
||||
* Configuration object for Pikku functions with Zod schema validation.
|
||||
* Use this when you want to define input/output schemas using Zod.
|
||||
* Types are automatically inferred from the schemas.
|
||||
*/
|
||||
type SchemaInferred<S, Fallback = unknown> = S extends StandardSchemaV1
|
||||
? InferSchemaOutput<S>
|
||||
: Fallback
|
||||
|
||||
/**
|
||||
* Schema-overload variant for pikkuFunc. Derived from CorePikkuFunctionConfig
|
||||
* so adding a field on the core type automatically propagates here.
|
||||
*/
|
||||
export type PikkuFunctionConfigWithSchema<
|
||||
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
||||
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
||||
RequiredWires extends keyof PikkuWire = never
|
||||
> = Omit<
|
||||
CorePikkuFunctionConfig<
|
||||
| PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
||||
| PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
||||
>,
|
||||
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
|
||||
> & {
|
||||
func:
|
||||
| PikkuFunction<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
||||
| PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
||||
input?: InputSchema
|
||||
output?: OutputSchema
|
||||
permissions?: InputSchema extends StandardSchemaV1
|
||||
? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
||||
: undefined
|
||||
approvalDescription?: InputSchema extends StandardSchemaV1
|
||||
? PikkuApprovalDescription<InferSchemaOutput<InputSchema>>
|
||||
: never
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Pikku function that can be either session-aware or sessionless.
|
||||
* This is the main function wrapper for creating API endpoints.
|
||||
*
|
||||
* Supports two patterns:
|
||||
* 1. Generic types: `pikkuFunc<Input, Output>({ func: ... })`
|
||||
* 2. Zod schemas: `pikkuFunc({ input: z.object(...), output: z.object(...), func: ... })`
|
||||
*
|
||||
* @template In - Input type for the function (inferred from schema if provided)
|
||||
* @template Out - Output type for the function (inferred from schema if provided)
|
||||
* @param func - Function definition, either direct function or configuration object
|
||||
* @returns The normalized configuration object
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Pattern 1: Using generic types
|
||||
* const createUser = pikkuFunc<{name: string, email: string}, {id: number}>({
|
||||
* func: async ({db}, input) => {
|
||||
* const user = await db.users.create(input)
|
||||
* return { id: user.id }
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* // Pattern 2: Using Zod schemas (types inferred automatically)
|
||||
* const createUserInput = z.object({ name: z.string(), email: z.string() })
|
||||
* const createUserOutput = z.object({ id: z.number() })
|
||||
*
|
||||
* const createUser = pikkuFunc({
|
||||
* input: createUserInput,
|
||||
* output: createUserOutput,
|
||||
* func: async ({db}, input) => {
|
||||
* // input is typed as { name: string, email: string }
|
||||
* const user = await db.users.create(input)
|
||||
* return { id: user.id } // must match output schema
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export function pikkuFunc<
|
||||
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
||||
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
||||
>(
|
||||
config: PikkuFunctionConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>
|
||||
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'session' | 'rpc'>
|
||||
export function pikkuFunc<In, Out = unknown>(
|
||||
func:
|
||||
| PikkuFunction<In, Out, 'session' | 'rpc'>
|
||||
| PikkuFunctionConfig<In, Out, 'session' | 'rpc'>
|
||||
): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>
|
||||
export function pikkuFunc(func: any) {
|
||||
return typeof func === 'function' ? { func } : func
|
||||
}
|
||||
|
||||
export type PikkuListFunction<
|
||||
F extends Record<string, unknown> = {},
|
||||
Row = unknown,
|
||||
S extends string = never
|
||||
> =
|
||||
| PikkuFunction<ListInput<F, S>, ListOutput<Row>, 'session' | 'rpc'>
|
||||
| PikkuFunctionSessionless<
|
||||
ListInput<F, S>,
|
||||
ListOutput<Row>,
|
||||
'session' | 'rpc'
|
||||
>
|
||||
|
||||
export const pikkuListFunc = <
|
||||
F extends Record<string, unknown> = {},
|
||||
Row = unknown,
|
||||
S extends string = never
|
||||
>(
|
||||
config: PikkuFunctionConfig<
|
||||
ListInput<F, S>,
|
||||
ListOutput<Row>,
|
||||
'session' | 'rpc'
|
||||
>
|
||||
): PikkuFunctionConfig<ListInput<F, S>, ListOutput<Row>, 'session' | 'rpc'> => {
|
||||
return pikkuFunc(config)
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration object for sessionless Pikku functions with Zod schema validation.
|
||||
*/
|
||||
/**
|
||||
* Schema-overload variant for pikkuSessionlessFunc. Derived from
|
||||
* CorePikkuFunctionConfig to stay in sync with the generic-typed config.
|
||||
*/
|
||||
export type PikkuFunctionSessionlessConfigWithSchema<
|
||||
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
||||
OutputSchema extends StandardSchemaV1 | undefined = undefined,
|
||||
RequiredWires extends keyof PikkuWire = never
|
||||
> = Omit<
|
||||
CorePikkuFunctionConfig<
|
||||
PikkuFunctionSessionless<SchemaInferred<InputSchema>, SchemaInferred<OutputSchema>, RequiredWires>
|
||||
>,
|
||||
'func' | 'input' | 'output' | 'permissions' | 'approvalDescription'
|
||||
> & {
|
||||
func: PikkuFunctionSessionless<
|
||||
SchemaInferred<InputSchema>,
|
||||
SchemaInferred<OutputSchema>,
|
||||
RequiredWires
|
||||
>
|
||||
input?: InputSchema
|
||||
output?: OutputSchema
|
||||
permissions?: InputSchema extends StandardSchemaV1
|
||||
? CorePermissionGroup<PikkuPermission<InferSchemaOutput<InputSchema>>>
|
||||
: undefined
|
||||
approvalDescription?: InputSchema extends StandardSchemaV1
|
||||
? PikkuApprovalDescription<InferSchemaOutput<InputSchema>>
|
||||
: never
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sessionless Pikku function that doesn't require user authentication.
|
||||
* Use this for public endpoints, webhooks, or background tasks.
|
||||
*
|
||||
* Supports two patterns:
|
||||
* 1. Generic types: `pikkuSessionlessFunc<Input, Output>({ func: ... })`
|
||||
* 2. Zod schemas: `pikkuSessionlessFunc({ input: z.object(...), func: ... })`
|
||||
*
|
||||
* @template In - Input type for the function (inferred from schema if provided)
|
||||
* @template Out - Output type for the function (inferred from schema if provided)
|
||||
* @param func - Function definition, either direct function or configuration object
|
||||
* @returns The normalized configuration object
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Pattern 1: Using generic types
|
||||
* const healthCheck = pikkuSessionlessFunc<void, {status: string}>({
|
||||
* func: async ({logger}) => {
|
||||
* return { status: 'healthy' }
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* // Pattern 2: Using Zod schemas
|
||||
* const greetInput = z.object({ name: z.string() })
|
||||
* const greetOutput = z.object({ message: z.string() })
|
||||
*
|
||||
* const greet = pikkuSessionlessFunc({
|
||||
* input: greetInput,
|
||||
* output: greetOutput,
|
||||
* func: async (_services, { name }) => {
|
||||
* return { message: `Hello, ${name}!` }
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export function pikkuSessionlessFunc<
|
||||
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
||||
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
||||
>(
|
||||
config: PikkuFunctionSessionlessConfigWithSchema<InputSchema, OutputSchema, 'session' | 'rpc'>
|
||||
): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'session' | 'rpc'>
|
||||
export function pikkuSessionlessFunc<In, Out = unknown>(
|
||||
func:
|
||||
| PikkuFunctionSessionless<In, Out, 'session' | 'rpc'>
|
||||
| PikkuFunctionConfig<In, Out, 'session' | 'rpc'>
|
||||
): PikkuFunctionConfig<In, Out, 'session' | 'rpc'>
|
||||
export function pikkuSessionlessFunc(func: any) {
|
||||
return typeof func === 'function' ? { func } : func
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that takes no input and returns no output.
|
||||
* Useful for health checks, triggers, or cleanup operations.
|
||||
*
|
||||
* @param func - Function definition, either direct function or configuration object
|
||||
* @returns The normalized configuration object
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* const cleanupTempFiles = pikkuVoidFunc(async ({fileSystem, logger}) => {
|
||||
* logger.info('Starting cleanup of temporary files')
|
||||
* await fileSystem.deleteDirectory('/tmp/uploads')
|
||||
* logger.info('Cleanup completed')
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuVoidFunc = (
|
||||
func:
|
||||
| PikkuFunctionSessionless<void, void, 'session' | 'rpc'>
|
||||
| PikkuFunctionConfig<void, void, 'session' | 'rpc'>
|
||||
) => {
|
||||
return typeof func === 'function' ? { func } : func
|
||||
}
|
||||
|
||||
/**
|
||||
* References a registered function by name for use in any wiring.
|
||||
* Works for both local and addon functions — resolves via RPC at runtime.
|
||||
*
|
||||
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
||||
* @param rpcName - The name of the function to reference
|
||||
* @returns A Pikku function config that proxies calls via RPC
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Use in agent tools
|
||||
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
||||
*
|
||||
* // Use in HTTP wiring
|
||||
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
||||
* ```
|
||||
*/
|
||||
export const ref = <Name extends keyof FlattenedRPCMap>(
|
||||
rpcName: Name
|
||||
): PikkuFunctionConfig<
|
||||
FlattenedRPCMap[Name]['input'],
|
||||
FlattenedRPCMap[Name]['output'],
|
||||
'session' | 'rpc'
|
||||
> => {
|
||||
return {
|
||||
func: async (_services: any, data: FlattenedRPCMap[Name]['input'], { rpc }: any) => {
|
||||
return rpc.invoke(rpcName, data)
|
||||
}
|
||||
} as PikkuFunctionConfig<
|
||||
FlattenedRPCMap[Name]['input'],
|
||||
FlattenedRPCMap[Name]['output'],
|
||||
'session' | 'rpc'
|
||||
>
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Pikku config factory.
|
||||
* Use this to define your application's configuration factory.
|
||||
*
|
||||
* @param func - Config factory function that returns your application's config
|
||||
* @returns The config factory function
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* export const createConfig = pikkuConfig(async () => {
|
||||
* return {
|
||||
* apiUrl: process.env.API_URL || 'http://localhost:3000',
|
||||
* dbUrl: process.env.DATABASE_URL
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuConfig = (
|
||||
func: (variables?: any, ...args: any[]) => Promise<Config>
|
||||
) => func
|
||||
|
||||
|
||||
/**
|
||||
* Creates a Pikku singleton services factory.
|
||||
* Use this to define services that are created once and shared across all requests.
|
||||
*
|
||||
* @param func - Singleton services factory function
|
||||
* @returns The singleton services factory function
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* export const createSingletonServices = pikkuServices(async (config, existingServices) => {
|
||||
* return {
|
||||
* config,
|
||||
* logger: new CustomLogger(),
|
||||
* db: await createDatabaseConnection(config.dbUrl)
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuServices = (
|
||||
func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<Partial<Omit<RequiredSingletonServices, 'auth'>>>
|
||||
) => {
|
||||
return async (config: Config, existingServices: Partial<SingletonServices> = {}) => {
|
||||
const createdServices = await func(config, existingServices)
|
||||
const services = { ...existingServices, ...createdServices }
|
||||
const authFactory = __pikkuState(null, 'package', 'authFactory')
|
||||
if (authFactory) {
|
||||
let authInstance: Promise<unknown> | undefined
|
||||
;(services as any).auth = () => {
|
||||
authInstance ??= Promise.resolve()
|
||||
.then(() => authFactory(services as any))
|
||||
.catch((error) => {
|
||||
authInstance = undefined
|
||||
throw error
|
||||
})
|
||||
return authInstance
|
||||
}
|
||||
}
|
||||
const resolved = services as RequiredSingletonServices
|
||||
__pikkuState(null, 'package', 'singletonServices', resolved as any)
|
||||
return resolved
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Pikku wire services factory.
|
||||
* Use this to define services that are created per-request/session.
|
||||
*
|
||||
* @param func - Wire services factory function
|
||||
* @returns The wire services factory function
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* export const createWireServices = pikkuWireServices(async (services, wire) => {
|
||||
* const session = await wire.session?.get()
|
||||
* return {
|
||||
* userCache: new UserCache(session?.userId)
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
export const pikkuWireServices = (
|
||||
func: (
|
||||
services: SingletonServices,
|
||||
wire: any
|
||||
) => Promise<RequiredWireServices>
|
||||
): CreateWireServices => {
|
||||
const factories = __pikkuState(null, 'package', 'factories')
|
||||
__pikkuState(null, 'package', 'factories', { ...factories, createWireServices: func as any })
|
||||
return func as unknown as CreateWireServices
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag-scoped middleware. Applies to any wiring that carries the matching tag.
|
||||
*
|
||||
* @example
|
||||
* addTagMiddleware('admin', [adminMiddleware])
|
||||
*/
|
||||
export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) => {
|
||||
addTagMiddlewareCore(tag, middleware as any, null)
|
||||
}
|
||||
|
||||
/**
|
||||
* Wire-agnostic global middleware. Runs at the top of every wiring's
|
||||
* middleware chain — before wire-, tag-, and function-level entries.
|
||||
*
|
||||
* Resolution order: global -> wire -> tag -> function.
|
||||
*
|
||||
* @example
|
||||
* addGlobalMiddleware([telemetryMiddleware])
|
||||
*/
|
||||
export const addGlobalMiddleware = (middleware: PikkuMiddleware[]) => {
|
||||
addGlobalMiddlewareCore(middleware as any, null)
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag-scoped permissions. Applies to any wiring that carries the matching tag.
|
||||
*
|
||||
* @example
|
||||
* addTagPermission('admin', [adminPermission])
|
||||
*/
|
||||
export const addTagPermission = <In = unknown>(tag: string, permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
|
||||
addTagPermissionCore(tag, permissions as any, null)
|
||||
}
|
||||
|
||||
/**
|
||||
* Wire-agnostic global permissions. Runs at the top of every wiring's
|
||||
* permission resolution — before wire-, tag-, and function-level entries.
|
||||
*
|
||||
* Resolution order: global -> wire -> tag -> function.
|
||||
*
|
||||
* @example
|
||||
* addGlobalPermission([signedInUser])
|
||||
*/
|
||||
export const addGlobalPermission = <In = unknown>(permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => {
|
||||
addGlobalPermissionCore(permissions as any, null)
|
||||
}
|
||||
|
||||
export { wireAddon } from '@pikku/core/rpc'
|
||||
export type { WireAddonConfig } from '@pikku/core/rpc'
|
||||
|
||||
|
||||
/**
|
||||
* Addon contract references. Generated from each wired addon's published
|
||||
* contract metadata — no addon source is imported. Functions are proxied via
|
||||
* ref() (RPC) exactly like ref('namespace:fn').
|
||||
*/
|
||||
const __addonHttp = {} as const
|
||||
const __addonChannel = {} as const
|
||||
const __addonCli = {} as const
|
||||
|
||||
export const refHTTP = <Name extends keyof typeof __addonHttp>(
|
||||
name: Name,
|
||||
options?: { basePath?: string }
|
||||
): (typeof __addonHttp)[Name] => {
|
||||
const contract = __addonHttp[name] as any
|
||||
return (
|
||||
options?.basePath !== undefined
|
||||
? { ...contract, basePath: options.basePath }
|
||||
: contract
|
||||
) as (typeof __addonHttp)[Name]
|
||||
}
|
||||
|
||||
export const refChannel = <Name extends keyof typeof __addonChannel>(
|
||||
name: Name
|
||||
): (typeof __addonChannel)[Name] => __addonChannel[name]
|
||||
|
||||
export const refCLI = <Name extends keyof typeof __addonCli>(
|
||||
name: Name
|
||||
): (typeof __addonCli)[Name] => __addonCli[name]
|
||||
@@ -0,0 +1,763 @@
|
||||
{
|
||||
"edgeEcho": {
|
||||
"pikkuFuncId": "edgeEcho",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "edgeEcho",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"inputSchemaName": "EdgeEchoInput",
|
||||
"outputSchemaName": "EdgeEchoOutput",
|
||||
"inputs": [
|
||||
"EdgeEchoInput"
|
||||
],
|
||||
"outputs": [
|
||||
"EdgeEchoOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "e1dd1c485212e3ea",
|
||||
"description": "Echoes a message back from a serverless edge Worker.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/functions/edge-echo.function.ts",
|
||||
"exportedName": "edgeEcho",
|
||||
"contractHash": "91dda37cd8231346",
|
||||
"inputHash": "3bb62634",
|
||||
"outputHash": "10641e1c"
|
||||
},
|
||||
"getMessage": {
|
||||
"pikkuFuncId": "getMessage",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuFunc",
|
||||
"sessionless": false,
|
||||
"name": "getMessage",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"kysely"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "GetMessageInput",
|
||||
"outputSchemaName": "GetMessageOutput",
|
||||
"inputs": [
|
||||
"GetMessageInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetMessageOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"readonly": true,
|
||||
"implementationHash": "90fc43e8778db110",
|
||||
"description": "Returns the current starter message for the signed-in user.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/functions/get-message.function.ts",
|
||||
"exportedName": "getMessage",
|
||||
"contractHash": "0b953679c3613f47",
|
||||
"inputHash": "cd075fe2",
|
||||
"outputHash": "d188ad31"
|
||||
},
|
||||
"getSession": {
|
||||
"pikkuFuncId": "getSession",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuFunc",
|
||||
"sessionless": false,
|
||||
"name": "getSession",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"kysely"
|
||||
]
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"session"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "GetSessionInput",
|
||||
"outputSchemaName": "GetSessionOutput",
|
||||
"inputs": [
|
||||
"GetSessionInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetSessionOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"readonly": true,
|
||||
"implementationHash": "2ed4f21ea016c7e3",
|
||||
"description": "Returns the current signed-in user.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/functions/get-session.function.ts",
|
||||
"exportedName": "getSession",
|
||||
"contractHash": "493320ce1e00cb69",
|
||||
"inputHash": "ba4ab2e7",
|
||||
"outputHash": "386fe409"
|
||||
},
|
||||
"serverCounter": {
|
||||
"pikkuFuncId": "serverCounter",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "serverCounter",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"inputSchemaName": "ServerCounterInput",
|
||||
"outputSchemaName": "ServerCounterOutput",
|
||||
"inputs": [
|
||||
"ServerCounterInput"
|
||||
],
|
||||
"outputs": [
|
||||
"ServerCounterOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"deploy": "server",
|
||||
"implementationHash": "8a956f633eb3a4a4",
|
||||
"description": "Increments an in-memory counter held by the container instance.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/functions/server-counter.function.ts",
|
||||
"exportedName": "serverCounter",
|
||||
"contractHash": "a891b2fe0608177d",
|
||||
"inputHash": "d8945f99",
|
||||
"outputHash": "56e3de15"
|
||||
},
|
||||
"serverUptime": {
|
||||
"pikkuFuncId": "serverUptime",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "serverUptime",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"inputSchemaName": "ServerUptimeInput",
|
||||
"outputSchemaName": "ServerUptimeOutput",
|
||||
"inputs": [
|
||||
"ServerUptimeInput"
|
||||
],
|
||||
"outputs": [
|
||||
"ServerUptimeOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"readonly": true,
|
||||
"deploy": "server",
|
||||
"implementationHash": "046d656adb63b531",
|
||||
"description": "Reports the serving container process uptime and runtime.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/functions/server-uptime.function.ts",
|
||||
"exportedName": "serverUptime",
|
||||
"contractHash": "d62f18b9b2739cd6",
|
||||
"inputHash": "5425fd1f",
|
||||
"outputHash": "4c1b3905"
|
||||
},
|
||||
"updateMessage": {
|
||||
"pikkuFuncId": "updateMessage",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuFunc",
|
||||
"sessionless": false,
|
||||
"name": "updateMessage",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"kysely"
|
||||
]
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"session"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "UpdateMessageInput",
|
||||
"outputSchemaName": "UpdateMessageOutput",
|
||||
"inputs": [
|
||||
"UpdateMessageInput"
|
||||
],
|
||||
"outputs": [
|
||||
"UpdateMessageOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "bfb74857a2ee5d16",
|
||||
"description": "Updates the current starter message.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/functions/update-message.function.ts",
|
||||
"exportedName": "updateMessage",
|
||||
"contractHash": "16e17af7cea46c7a",
|
||||
"inputHash": "77b14595",
|
||||
"outputHash": "bca77943"
|
||||
},
|
||||
"agentCaller": {
|
||||
"pikkuFuncId": "agentCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentCaller",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"rpc"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "AgentCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "4af198bf5bbd9bd8",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "agentCaller",
|
||||
"contractHash": "76619abd99f23189",
|
||||
"inputHash": "4d1eddbc",
|
||||
"outputHash": "9a3af204"
|
||||
},
|
||||
"agentStreamCaller": {
|
||||
"pikkuFuncId": "agentStreamCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentStreamCaller",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"rpc"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "AgentStreamCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentStreamCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "5d475a264b62cc63",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "agentStreamCaller",
|
||||
"contractHash": "440ca8bea8919cc6",
|
||||
"inputHash": "6b434982",
|
||||
"outputHash": "641a263e"
|
||||
},
|
||||
"agentApproveCaller": {
|
||||
"pikkuFuncId": "agentApproveCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentApproveCaller",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"rpc"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "AgentApproveCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentApproveCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "ae5d4bfb0293119a",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "agentApproveCaller",
|
||||
"contractHash": "83a9293c4b51d65c",
|
||||
"inputHash": "f1628b7c",
|
||||
"outputHash": "ef71f08a"
|
||||
},
|
||||
"agentResumeCaller": {
|
||||
"pikkuFuncId": "agentResumeCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentResumeCaller",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"rpc"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "AgentResumeCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentResumeCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "d17ccf1259ba4a60",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "agentResumeCaller",
|
||||
"contractHash": "0648ffb2cfa9d861",
|
||||
"inputHash": "f25b50dd",
|
||||
"outputHash": "ee89e454"
|
||||
},
|
||||
"getAgentThreads": {
|
||||
"pikkuFuncId": "getAgentThreads",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "getAgentThreads",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"agentRunService"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "GetAgentThreadsInput",
|
||||
"outputSchemaName": "GetAgentThreadsOutput",
|
||||
"inputs": [
|
||||
"GetAgentThreadsInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetAgentThreadsOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "3823f8f3911c48e2",
|
||||
"title": "Get Agent Threads",
|
||||
"tags": [
|
||||
"pikku",
|
||||
"pikku:agent"
|
||||
],
|
||||
"description": "Returns a list of AI agent threads from storage. Accepts optional filters: agentName, resourceId, limit, and offset for pagination.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "getAgentThreads",
|
||||
"contractHash": "d629208347702d27",
|
||||
"inputHash": "41f5350c",
|
||||
"outputHash": "6598bdff"
|
||||
},
|
||||
"getAgentThreadMessages": {
|
||||
"pikkuFuncId": "getAgentThreadMessages",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "getAgentThreadMessages",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"agentRunService"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "GetAgentThreadMessagesInput",
|
||||
"outputSchemaName": "GetAgentThreadMessagesOutput",
|
||||
"inputs": [
|
||||
"GetAgentThreadMessagesInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetAgentThreadMessagesOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "dffe581287205c6e",
|
||||
"title": "Get Agent Thread Messages",
|
||||
"tags": [
|
||||
"pikku",
|
||||
"pikku:agent"
|
||||
],
|
||||
"description": "Returns all messages for a given AI agent thread, ordered by creation time.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "getAgentThreadMessages",
|
||||
"contractHash": "44e43e96024680f3",
|
||||
"inputHash": "a158e652",
|
||||
"outputHash": "04960780"
|
||||
},
|
||||
"getAgentThreadRuns": {
|
||||
"pikkuFuncId": "getAgentThreadRuns",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "getAgentThreadRuns",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"agentRunService"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "GetAgentThreadRunsInput",
|
||||
"outputSchemaName": "GetAgentThreadRunsOutput",
|
||||
"inputs": [
|
||||
"GetAgentThreadRunsInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetAgentThreadRunsOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "2e83ec1d0e08772d",
|
||||
"title": "Get Agent Thread Runs",
|
||||
"tags": [
|
||||
"pikku",
|
||||
"pikku:agent"
|
||||
],
|
||||
"description": "Returns the run history for a given AI agent thread, ordered by creation time.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "getAgentThreadRuns",
|
||||
"contractHash": "c51892c37c245537",
|
||||
"inputHash": "fb544997",
|
||||
"outputHash": "6352aca1"
|
||||
},
|
||||
"deleteAgentThread": {
|
||||
"pikkuFuncId": "deleteAgentThread",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "deleteAgentThread",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"agentRunService"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "DeleteAgentThreadInput",
|
||||
"outputSchemaName": "DeleteAgentThreadOutput",
|
||||
"inputs": [
|
||||
"DeleteAgentThreadInput"
|
||||
],
|
||||
"outputs": [
|
||||
"DeleteAgentThreadOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "7c0d0fb40a42fc20",
|
||||
"title": "Delete Agent Thread",
|
||||
"tags": [
|
||||
"pikku",
|
||||
"pikku:agent"
|
||||
],
|
||||
"description": "Deletes an AI agent thread and all of its persisted state.",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/agent.gen.ts",
|
||||
"exportedName": "deleteAgentThread",
|
||||
"contractHash": "b970011db1e0230e",
|
||||
"inputHash": "3ed36ee5",
|
||||
"outputHash": "a2094cc1"
|
||||
},
|
||||
"authHandler": {
|
||||
"pikkuFuncId": "authHandler",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "authHandler",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"kysely",
|
||||
"secrets"
|
||||
]
|
||||
},
|
||||
"wires": {
|
||||
"optimized": false,
|
||||
"wires": []
|
||||
},
|
||||
"inputSchemaName": null,
|
||||
"outputSchemaName": "AuthHandlerOutput",
|
||||
"inputs": [],
|
||||
"outputs": [
|
||||
"AuthHandlerOutput"
|
||||
],
|
||||
"implementationHash": "7b1988fee5ec048e",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/auth.gen.ts",
|
||||
"exportedName": "authHandler",
|
||||
"contractHash": "56ca81afb5965d88",
|
||||
"inputHash": "3db46710",
|
||||
"outputHash": "4a0c6eec"
|
||||
},
|
||||
"pikkuConsoleSetSecret": {
|
||||
"pikkuFuncId": "pikkuConsoleSetSecret",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleSetSecret",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"secrets"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "PikkuConsoleSetSecretInput",
|
||||
"outputSchemaName": "PikkuConsoleSetSecretOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleSetSecretInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleSetSecretOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "403f267c2ff0edad",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"description": "Set the value of a secret",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/console.gen.ts",
|
||||
"exportedName": "pikkuConsoleSetSecret",
|
||||
"contractHash": "fcb625d86fe88b8f",
|
||||
"inputHash": "a0c8a043",
|
||||
"outputHash": "57702b41"
|
||||
},
|
||||
"pikkuConsoleGetVariable": {
|
||||
"pikkuFuncId": "pikkuConsoleGetVariable",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleGetVariable",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"variables"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "PikkuConsoleGetVariableInput",
|
||||
"outputSchemaName": "PikkuConsoleGetVariableOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleGetVariableInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleGetVariableOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "a2637db8df0daa91",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"description": "Get the current value of a variable",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/console.gen.ts",
|
||||
"exportedName": "pikkuConsoleGetVariable",
|
||||
"contractHash": "3b66dda4d82fa48a",
|
||||
"inputHash": "ce4b2e06",
|
||||
"outputHash": "f54f1059"
|
||||
},
|
||||
"pikkuConsoleSetVariable": {
|
||||
"pikkuFuncId": "pikkuConsoleSetVariable",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleSetVariable",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"variables"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "PikkuConsoleSetVariableInput",
|
||||
"outputSchemaName": "PikkuConsoleSetVariableOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleSetVariableInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleSetVariableOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "4fac80de849be6c9",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"description": "Set the value of a variable",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/console.gen.ts",
|
||||
"exportedName": "pikkuConsoleSetVariable",
|
||||
"contractHash": "9dda40633b173a08",
|
||||
"inputHash": "d91a4af5",
|
||||
"outputHash": "91fe907b"
|
||||
},
|
||||
"pikkuConsoleHasSecret": {
|
||||
"pikkuFuncId": "pikkuConsoleHasSecret",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleHasSecret",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"secrets"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "PikkuConsoleHasSecretInput",
|
||||
"outputSchemaName": "PikkuConsoleHasSecretOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleHasSecretInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleHasSecretOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "b8c818fb2291b032",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"description": "Check if a secret exists without reading its value",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/console.gen.ts",
|
||||
"exportedName": "pikkuConsoleHasSecret",
|
||||
"contractHash": "eeff751c00461679",
|
||||
"inputHash": "a67adc7c",
|
||||
"outputHash": "1da66eac"
|
||||
},
|
||||
"pikkuConsoleGetSecret": {
|
||||
"pikkuFuncId": "pikkuConsoleGetSecret",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleGetSecret",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": [
|
||||
"secrets"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "PikkuConsoleGetSecretInput",
|
||||
"outputSchemaName": "PikkuConsoleGetSecretOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleGetSecretInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleGetSecretOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "6808aead5cd1896a",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"description": "Get the current value of a secret",
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/console.gen.ts",
|
||||
"exportedName": "pikkuConsoleGetSecret",
|
||||
"contractHash": "d651ad93642eaeed",
|
||||
"inputHash": "329251da",
|
||||
"outputHash": "fb675a26"
|
||||
},
|
||||
"http:get:/workflow-run/:runId/stream": {
|
||||
"pikkuFuncId": "http:get:/workflow-run/:runId/stream",
|
||||
"functionType": "inline",
|
||||
"name": "/workflow-run/:runId/stream",
|
||||
"services": {
|
||||
"optimized": false,
|
||||
"services": []
|
||||
},
|
||||
"inputSchemaName": "StreamWorkflowRunInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"StreamWorkflowRunInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"sessionless": true,
|
||||
"contractHash": "b693c43c3c0f10d5",
|
||||
"inputHash": "e0a18a17",
|
||||
"outputHash": "fc2fd4a0"
|
||||
},
|
||||
"http:get:/function-tests/stream": {
|
||||
"pikkuFuncId": "http:get:/function-tests/stream",
|
||||
"functionType": "inline",
|
||||
"name": "/function-tests/stream",
|
||||
"services": {
|
||||
"optimized": false,
|
||||
"services": []
|
||||
},
|
||||
"inputSchemaName": null,
|
||||
"outputSchemaName": "StreamFunctionTestsOutput",
|
||||
"inputs": [],
|
||||
"outputs": [
|
||||
"StreamFunctionTestsOutput"
|
||||
],
|
||||
"sessionless": true,
|
||||
"contractHash": "de6cfac52a493763",
|
||||
"inputHash": "748d80cf",
|
||||
"outputHash": "2090bce5"
|
||||
},
|
||||
"rpcCaller": {
|
||||
"pikkuFuncId": "rpcCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "rpcCaller",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"rpc"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "RpcCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"RpcCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "f92b60dda357f483",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/rpc-public.gen.ts",
|
||||
"exportedName": "rpcCaller",
|
||||
"contractHash": "f6901fd233740bf4",
|
||||
"inputHash": "a69cacc4",
|
||||
"outputHash": "629e0b5a"
|
||||
},
|
||||
"remoteRPCHandler": {
|
||||
"pikkuFuncId": "remoteRPCHandler",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "remoteRPCHandler",
|
||||
"services": {
|
||||
"optimized": true,
|
||||
"services": []
|
||||
},
|
||||
"wires": {
|
||||
"optimized": true,
|
||||
"wires": [
|
||||
"rpc"
|
||||
]
|
||||
},
|
||||
"inputSchemaName": "RemoteRPCHandlerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"RemoteRPCHandlerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"remote": true,
|
||||
"implementationHash": "105018a823bdb551",
|
||||
"tags": [
|
||||
"pikku"
|
||||
],
|
||||
"isDirectFunction": false,
|
||||
"sourceFile": "/Users/yasser/git/pikku/fabric/templates/server-and-serverless/packages/functions/src/scaffold/rpc-remote.gen.ts",
|
||||
"exportedName": "remoteRPCHandler"
|
||||
}
|
||||
}
|
||||
454
packages/functions/.pikku/function/pikku-functions-meta.gen.json
Normal file
454
packages/functions/.pikku/function/pikku-functions-meta.gen.json
Normal file
@@ -0,0 +1,454 @@
|
||||
{
|
||||
"edgeEcho": {
|
||||
"pikkuFuncId": "edgeEcho",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "edgeEcho",
|
||||
"inputSchemaName": "EdgeEchoInput",
|
||||
"outputSchemaName": "EdgeEchoOutput",
|
||||
"inputs": [
|
||||
"EdgeEchoInput"
|
||||
],
|
||||
"outputs": [
|
||||
"EdgeEchoOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "e1dd1c485212e3ea",
|
||||
"contractHash": "91dda37cd8231346",
|
||||
"inputHash": "3bb62634",
|
||||
"outputHash": "10641e1c"
|
||||
},
|
||||
"getMessage": {
|
||||
"pikkuFuncId": "getMessage",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuFunc",
|
||||
"sessionless": false,
|
||||
"name": "getMessage",
|
||||
"inputSchemaName": "GetMessageInput",
|
||||
"outputSchemaName": "GetMessageOutput",
|
||||
"inputs": [
|
||||
"GetMessageInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetMessageOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"readonly": true,
|
||||
"implementationHash": "90fc43e8778db110",
|
||||
"contractHash": "0b953679c3613f47",
|
||||
"inputHash": "cd075fe2",
|
||||
"outputHash": "d188ad31"
|
||||
},
|
||||
"getSession": {
|
||||
"pikkuFuncId": "getSession",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuFunc",
|
||||
"sessionless": false,
|
||||
"name": "getSession",
|
||||
"inputSchemaName": "GetSessionInput",
|
||||
"outputSchemaName": "GetSessionOutput",
|
||||
"inputs": [
|
||||
"GetSessionInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetSessionOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"readonly": true,
|
||||
"implementationHash": "2ed4f21ea016c7e3",
|
||||
"contractHash": "493320ce1e00cb69",
|
||||
"inputHash": "ba4ab2e7",
|
||||
"outputHash": "386fe409"
|
||||
},
|
||||
"serverCounter": {
|
||||
"pikkuFuncId": "serverCounter",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "serverCounter",
|
||||
"inputSchemaName": "ServerCounterInput",
|
||||
"outputSchemaName": "ServerCounterOutput",
|
||||
"inputs": [
|
||||
"ServerCounterInput"
|
||||
],
|
||||
"outputs": [
|
||||
"ServerCounterOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"deploy": "server",
|
||||
"implementationHash": "8a956f633eb3a4a4",
|
||||
"contractHash": "a891b2fe0608177d",
|
||||
"inputHash": "d8945f99",
|
||||
"outputHash": "56e3de15"
|
||||
},
|
||||
"serverUptime": {
|
||||
"pikkuFuncId": "serverUptime",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "serverUptime",
|
||||
"inputSchemaName": "ServerUptimeInput",
|
||||
"outputSchemaName": "ServerUptimeOutput",
|
||||
"inputs": [
|
||||
"ServerUptimeInput"
|
||||
],
|
||||
"outputs": [
|
||||
"ServerUptimeOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"readonly": true,
|
||||
"deploy": "server",
|
||||
"implementationHash": "046d656adb63b531",
|
||||
"contractHash": "d62f18b9b2739cd6",
|
||||
"inputHash": "5425fd1f",
|
||||
"outputHash": "4c1b3905"
|
||||
},
|
||||
"updateMessage": {
|
||||
"pikkuFuncId": "updateMessage",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuFunc",
|
||||
"sessionless": false,
|
||||
"name": "updateMessage",
|
||||
"inputSchemaName": "UpdateMessageInput",
|
||||
"outputSchemaName": "UpdateMessageOutput",
|
||||
"inputs": [
|
||||
"UpdateMessageInput"
|
||||
],
|
||||
"outputs": [
|
||||
"UpdateMessageOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "bfb74857a2ee5d16",
|
||||
"contractHash": "16e17af7cea46c7a",
|
||||
"inputHash": "77b14595",
|
||||
"outputHash": "bca77943"
|
||||
},
|
||||
"agentCaller": {
|
||||
"pikkuFuncId": "agentCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentCaller",
|
||||
"inputSchemaName": "AgentCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "4af198bf5bbd9bd8",
|
||||
"contractHash": "76619abd99f23189",
|
||||
"inputHash": "4d1eddbc",
|
||||
"outputHash": "9a3af204"
|
||||
},
|
||||
"agentStreamCaller": {
|
||||
"pikkuFuncId": "agentStreamCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentStreamCaller",
|
||||
"inputSchemaName": "AgentStreamCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentStreamCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "5d475a264b62cc63",
|
||||
"contractHash": "440ca8bea8919cc6",
|
||||
"inputHash": "6b434982",
|
||||
"outputHash": "641a263e"
|
||||
},
|
||||
"agentApproveCaller": {
|
||||
"pikkuFuncId": "agentApproveCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentApproveCaller",
|
||||
"inputSchemaName": "AgentApproveCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentApproveCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "ae5d4bfb0293119a",
|
||||
"contractHash": "83a9293c4b51d65c",
|
||||
"inputHash": "f1628b7c",
|
||||
"outputHash": "ef71f08a"
|
||||
},
|
||||
"agentResumeCaller": {
|
||||
"pikkuFuncId": "agentResumeCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "agentResumeCaller",
|
||||
"inputSchemaName": "AgentResumeCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"AgentResumeCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "d17ccf1259ba4a60",
|
||||
"contractHash": "0648ffb2cfa9d861",
|
||||
"inputHash": "f25b50dd",
|
||||
"outputHash": "ee89e454"
|
||||
},
|
||||
"getAgentThreads": {
|
||||
"pikkuFuncId": "getAgentThreads",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "getAgentThreads",
|
||||
"inputSchemaName": "GetAgentThreadsInput",
|
||||
"outputSchemaName": "GetAgentThreadsOutput",
|
||||
"inputs": [
|
||||
"GetAgentThreadsInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetAgentThreadsOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "3823f8f3911c48e2",
|
||||
"contractHash": "d629208347702d27",
|
||||
"inputHash": "41f5350c",
|
||||
"outputHash": "6598bdff"
|
||||
},
|
||||
"getAgentThreadMessages": {
|
||||
"pikkuFuncId": "getAgentThreadMessages",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "getAgentThreadMessages",
|
||||
"inputSchemaName": "GetAgentThreadMessagesInput",
|
||||
"outputSchemaName": "GetAgentThreadMessagesOutput",
|
||||
"inputs": [
|
||||
"GetAgentThreadMessagesInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetAgentThreadMessagesOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "dffe581287205c6e",
|
||||
"contractHash": "44e43e96024680f3",
|
||||
"inputHash": "a158e652",
|
||||
"outputHash": "04960780"
|
||||
},
|
||||
"getAgentThreadRuns": {
|
||||
"pikkuFuncId": "getAgentThreadRuns",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "getAgentThreadRuns",
|
||||
"inputSchemaName": "GetAgentThreadRunsInput",
|
||||
"outputSchemaName": "GetAgentThreadRunsOutput",
|
||||
"inputs": [
|
||||
"GetAgentThreadRunsInput"
|
||||
],
|
||||
"outputs": [
|
||||
"GetAgentThreadRunsOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "2e83ec1d0e08772d",
|
||||
"contractHash": "c51892c37c245537",
|
||||
"inputHash": "fb544997",
|
||||
"outputHash": "6352aca1"
|
||||
},
|
||||
"deleteAgentThread": {
|
||||
"pikkuFuncId": "deleteAgentThread",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "deleteAgentThread",
|
||||
"inputSchemaName": "DeleteAgentThreadInput",
|
||||
"outputSchemaName": "DeleteAgentThreadOutput",
|
||||
"inputs": [
|
||||
"DeleteAgentThreadInput"
|
||||
],
|
||||
"outputs": [
|
||||
"DeleteAgentThreadOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "7c0d0fb40a42fc20",
|
||||
"contractHash": "b970011db1e0230e",
|
||||
"inputHash": "3ed36ee5",
|
||||
"outputHash": "a2094cc1"
|
||||
},
|
||||
"authHandler": {
|
||||
"pikkuFuncId": "authHandler",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "authHandler",
|
||||
"inputSchemaName": null,
|
||||
"outputSchemaName": "AuthHandlerOutput",
|
||||
"inputs": [],
|
||||
"outputs": [
|
||||
"AuthHandlerOutput"
|
||||
],
|
||||
"implementationHash": "7b1988fee5ec048e",
|
||||
"contractHash": "56ca81afb5965d88",
|
||||
"inputHash": "3db46710",
|
||||
"outputHash": "4a0c6eec"
|
||||
},
|
||||
"pikkuConsoleSetSecret": {
|
||||
"pikkuFuncId": "pikkuConsoleSetSecret",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleSetSecret",
|
||||
"inputSchemaName": "PikkuConsoleSetSecretInput",
|
||||
"outputSchemaName": "PikkuConsoleSetSecretOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleSetSecretInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleSetSecretOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "403f267c2ff0edad",
|
||||
"contractHash": "fcb625d86fe88b8f",
|
||||
"inputHash": "a0c8a043",
|
||||
"outputHash": "57702b41"
|
||||
},
|
||||
"pikkuConsoleGetVariable": {
|
||||
"pikkuFuncId": "pikkuConsoleGetVariable",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleGetVariable",
|
||||
"inputSchemaName": "PikkuConsoleGetVariableInput",
|
||||
"outputSchemaName": "PikkuConsoleGetVariableOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleGetVariableInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleGetVariableOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "a2637db8df0daa91",
|
||||
"contractHash": "3b66dda4d82fa48a",
|
||||
"inputHash": "ce4b2e06",
|
||||
"outputHash": "f54f1059"
|
||||
},
|
||||
"pikkuConsoleSetVariable": {
|
||||
"pikkuFuncId": "pikkuConsoleSetVariable",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleSetVariable",
|
||||
"inputSchemaName": "PikkuConsoleSetVariableInput",
|
||||
"outputSchemaName": "PikkuConsoleSetVariableOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleSetVariableInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleSetVariableOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "4fac80de849be6c9",
|
||||
"contractHash": "9dda40633b173a08",
|
||||
"inputHash": "d91a4af5",
|
||||
"outputHash": "91fe907b"
|
||||
},
|
||||
"pikkuConsoleHasSecret": {
|
||||
"pikkuFuncId": "pikkuConsoleHasSecret",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleHasSecret",
|
||||
"inputSchemaName": "PikkuConsoleHasSecretInput",
|
||||
"outputSchemaName": "PikkuConsoleHasSecretOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleHasSecretInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleHasSecretOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "b8c818fb2291b032",
|
||||
"contractHash": "eeff751c00461679",
|
||||
"inputHash": "a67adc7c",
|
||||
"outputHash": "1da66eac"
|
||||
},
|
||||
"pikkuConsoleGetSecret": {
|
||||
"pikkuFuncId": "pikkuConsoleGetSecret",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "pikkuConsoleGetSecret",
|
||||
"inputSchemaName": "PikkuConsoleGetSecretInput",
|
||||
"outputSchemaName": "PikkuConsoleGetSecretOutput",
|
||||
"inputs": [
|
||||
"PikkuConsoleGetSecretInput"
|
||||
],
|
||||
"outputs": [
|
||||
"PikkuConsoleGetSecretOutput"
|
||||
],
|
||||
"expose": true,
|
||||
"implementationHash": "6808aead5cd1896a",
|
||||
"contractHash": "d651ad93642eaeed",
|
||||
"inputHash": "329251da",
|
||||
"outputHash": "fb675a26"
|
||||
},
|
||||
"http:get:/workflow-run/:runId/stream": {
|
||||
"pikkuFuncId": "http:get:/workflow-run/:runId/stream",
|
||||
"functionType": "inline",
|
||||
"name": "/workflow-run/:runId/stream",
|
||||
"inputSchemaName": "StreamWorkflowRunInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"StreamWorkflowRunInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"sessionless": true,
|
||||
"contractHash": "b693c43c3c0f10d5",
|
||||
"inputHash": "e0a18a17",
|
||||
"outputHash": "fc2fd4a0"
|
||||
},
|
||||
"http:get:/function-tests/stream": {
|
||||
"pikkuFuncId": "http:get:/function-tests/stream",
|
||||
"functionType": "inline",
|
||||
"name": "/function-tests/stream",
|
||||
"inputSchemaName": null,
|
||||
"outputSchemaName": "StreamFunctionTestsOutput",
|
||||
"inputs": [],
|
||||
"outputs": [
|
||||
"StreamFunctionTestsOutput"
|
||||
],
|
||||
"sessionless": true,
|
||||
"contractHash": "de6cfac52a493763",
|
||||
"inputHash": "748d80cf",
|
||||
"outputHash": "2090bce5"
|
||||
},
|
||||
"rpcCaller": {
|
||||
"pikkuFuncId": "rpcCaller",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "rpcCaller",
|
||||
"inputSchemaName": "RpcCallerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"RpcCallerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"implementationHash": "f92b60dda357f483",
|
||||
"contractHash": "f6901fd233740bf4",
|
||||
"inputHash": "a69cacc4",
|
||||
"outputHash": "629e0b5a"
|
||||
},
|
||||
"remoteRPCHandler": {
|
||||
"pikkuFuncId": "remoteRPCHandler",
|
||||
"functionType": "user",
|
||||
"funcWrapper": "pikkuSessionlessFunc",
|
||||
"sessionless": true,
|
||||
"name": "remoteRPCHandler",
|
||||
"inputSchemaName": "RemoteRPCHandlerInput",
|
||||
"outputSchemaName": null,
|
||||
"inputs": [
|
||||
"RemoteRPCHandlerInput"
|
||||
],
|
||||
"outputs": [],
|
||||
"remote": true,
|
||||
"implementationHash": "105018a823bdb551"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.54
|
||||
*/
|
||||
import { pikkuState } from '@pikku/core/internal'
|
||||
import type { FunctionsMeta } from '@pikku/core'
|
||||
import metaData from './pikku-functions-meta.gen.json' with { type: 'json' }
|
||||
pikkuState(null, 'function', 'meta', metaData as FunctionsMeta)
|
||||
38
packages/functions/.pikku/function/pikku-functions.gen.ts
Normal file
38
packages/functions/.pikku/function/pikku-functions.gen.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.54
|
||||
*/
|
||||
/* Import and register functions used by RPCs */
|
||||
import { addFunction } from '@pikku/core/function'
|
||||
import { deleteAgentThread } from '../../src/scaffold/agent.gen.js'
|
||||
import { edgeEcho } from '../../src/functions/edge-echo.function.js'
|
||||
import { getAgentThreadMessages } from '../../src/scaffold/agent.gen.js'
|
||||
import { getAgentThreadRuns } from '../../src/scaffold/agent.gen.js'
|
||||
import { getAgentThreads } from '../../src/scaffold/agent.gen.js'
|
||||
import { getMessage } from '../../src/functions/get-message.function.js'
|
||||
import { getSession } from '../../src/functions/get-session.function.js'
|
||||
import { pikkuConsoleGetSecret } from '../../src/scaffold/console.gen.js'
|
||||
import { pikkuConsoleGetVariable } from '../../src/scaffold/console.gen.js'
|
||||
import { pikkuConsoleHasSecret } from '../../src/scaffold/console.gen.js'
|
||||
import { pikkuConsoleSetSecret } from '../../src/scaffold/console.gen.js'
|
||||
import { pikkuConsoleSetVariable } from '../../src/scaffold/console.gen.js'
|
||||
import { remoteRPCHandler } from '../../src/scaffold/rpc-remote.gen.js'
|
||||
import { serverCounter } from '../../src/functions/server-counter.function.js'
|
||||
import { serverUptime } from '../../src/functions/server-uptime.function.js'
|
||||
import { updateMessage } from '../../src/functions/update-message.function.js'
|
||||
|
||||
addFunction('deleteAgentThread', deleteAgentThread)
|
||||
addFunction('edgeEcho', edgeEcho)
|
||||
addFunction('getAgentThreadMessages', getAgentThreadMessages)
|
||||
addFunction('getAgentThreadRuns', getAgentThreadRuns)
|
||||
addFunction('getAgentThreads', getAgentThreads)
|
||||
addFunction('getMessage', getMessage)
|
||||
addFunction('getSession', getSession)
|
||||
addFunction('pikkuConsoleGetSecret', pikkuConsoleGetSecret)
|
||||
addFunction('pikkuConsoleGetVariable', pikkuConsoleGetVariable)
|
||||
addFunction('pikkuConsoleHasSecret', pikkuConsoleHasSecret)
|
||||
addFunction('pikkuConsoleSetSecret', pikkuConsoleSetSecret)
|
||||
addFunction('pikkuConsoleSetVariable', pikkuConsoleSetVariable)
|
||||
addFunction('remoteRPCHandler', remoteRPCHandler)
|
||||
addFunction('serverCounter', serverCounter)
|
||||
addFunction('serverUptime', serverUptime)
|
||||
addFunction('updateMessage', updateMessage)
|
||||
Reference in New Issue
Block a user