chore: server-and-serverless template
This commit is contained in:
27
packages/functions/.pikku/queue/pikku-queue-types.gen.ts
Normal file
27
packages/functions/.pikku/queue/pikku-queue-types.gen.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.54
|
||||
*/
|
||||
/**
|
||||
* Queue-specific type definitions for tree-shaking optimization
|
||||
*/
|
||||
|
||||
import { CoreQueueWorker, wireQueueWorker as wireQueueWorkerCore } from '@pikku/core/queue'
|
||||
import type { PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
|
||||
|
||||
/**
|
||||
* Type definition for queue workers that process background jobs.
|
||||
*
|
||||
* @template In - Input type for the queue job
|
||||
* @template Out - Output type for the queue job
|
||||
*/
|
||||
type QueueWiring<In, Out> = CoreQueueWorker<PikkuFunctionConfig<In, Out, 'session' | 'rpc'>>
|
||||
|
||||
/**
|
||||
* Registers a queue worker with the Pikku framework.
|
||||
* Workers process background jobs from queues.
|
||||
*
|
||||
* @param queueWorker - Queue worker definition with job handler
|
||||
*/
|
||||
export const wireQueueWorker = (queueWorker: QueueWiring<any, any>) => {
|
||||
wireQueueWorkerCore(queueWorker as any)
|
||||
}
|
||||
116
packages/functions/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts
vendored
Normal file
116
packages/functions/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.54
|
||||
*/
|
||||
/**
|
||||
* This provides the structure needed for typescript to be aware of Queue workers and their input/output types
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
export type AgentApproveCallerInput = { agentName: string; runId: string; approvals: { toolCallId: string; approved: boolean; }[]; }
|
||||
export type AgentCallerInput = { agentName: string; message: string; threadId: string; resourceId: string; }
|
||||
export type AgentResumeCallerInput = { agentName: string; runId: string; toolCallId: string; approved: boolean; }
|
||||
export type AgentStreamCallerInput = { agentName: string; message: string; threadId: string; resourceId: string; context?: string; }
|
||||
export type AuthHandlerOutput = Promise<any> | Promise<void>
|
||||
export type DeleteAgentThreadInput = { threadId: string; resourceId?: string; }
|
||||
export type DeleteAgentThreadOutput = { deleted: boolean; }
|
||||
export type EdgeEchoInput = {
|
||||
message: string;
|
||||
}
|
||||
export type EdgeEchoOutput = {
|
||||
echoed: string;
|
||||
serverless: boolean;
|
||||
}
|
||||
export type GetAgentThreadMessagesInput = { threadId: string; resourceId?: string; }
|
||||
export type GetAgentThreadMessagesOutput = any[]
|
||||
export type GetAgentThreadRunsInput = { threadId: string; resourceId?: string; }
|
||||
export type GetAgentThreadRunsOutput = any[]
|
||||
export type GetAgentThreadsInput = { agentName?: string; resourceId?: string; limit?: number; offset?: number; }
|
||||
export type GetAgentThreadsOutput = any[]
|
||||
export type GetMessageInput = {}
|
||||
export type GetMessageOutput = {
|
||||
message: string;
|
||||
updatedAt: string;
|
||||
updatedBy: {
|
||||
email: string;
|
||||
name: string | null;
|
||||
} | null;
|
||||
}
|
||||
export type GetSessionInput = {}
|
||||
export type GetSessionOutput = {
|
||||
userId: string;
|
||||
email: string;
|
||||
name: string | null;
|
||||
}
|
||||
export type PikkuConsoleGetSecretInput = { secretId: string; }
|
||||
export type PikkuConsoleGetSecretOutput = { exists: boolean; value: unknown; }
|
||||
export type PikkuConsoleGetVariableInput = { variableId: string; }
|
||||
export type PikkuConsoleGetVariableOutput = { exists: boolean; value: unknown; }
|
||||
export type PikkuConsoleHasSecretInput = { secretId: string; }
|
||||
export type PikkuConsoleHasSecretOutput = { exists: boolean; }
|
||||
export type PikkuConsoleSetSecretInput = { secretId: string; value: unknown; }
|
||||
export type PikkuConsoleSetSecretOutput = { success: boolean; }
|
||||
export type PikkuConsoleSetVariableInput = { variableId: string; value: unknown; }
|
||||
export type PikkuConsoleSetVariableOutput = { success: boolean; }
|
||||
export type RemoteRPCHandlerInput = { rpcName: string; data?: unknown; }
|
||||
export type RpcCallerInput = { rpcName: string; data?: unknown; }
|
||||
export type SecretSchema_betterAuthSecret = string
|
||||
export type ServerCounterInput = {}
|
||||
export type ServerCounterOutput = {
|
||||
count: number;
|
||||
pid: number;
|
||||
}
|
||||
export type ServerUptimeInput = {}
|
||||
export type ServerUptimeOutput = {
|
||||
uptimeSeconds: number;
|
||||
nodeVersion: string;
|
||||
rssMb: number;
|
||||
}
|
||||
export type UpdateMessageInput = {
|
||||
message: string;
|
||||
}
|
||||
export type UpdateMessageOutput = {
|
||||
message: string;
|
||||
updatedAt: string;
|
||||
updatedBy: {
|
||||
email: string;
|
||||
name: string | null;
|
||||
} | null;
|
||||
}
|
||||
|
||||
import type { QueueJob } from '@pikku/core/queue'
|
||||
|
||||
interface QueueHandler<I, O> {
|
||||
input: I;
|
||||
output: O;
|
||||
}
|
||||
|
||||
export type QueueMap = {
|
||||
readonly 'pikku-remote-internal-rpc': QueueHandler<RemoteRPCHandlerInput, null>,
|
||||
};
|
||||
|
||||
|
||||
type QueueAdd = <Name extends keyof QueueMap>(
|
||||
name: Name,
|
||||
data: QueueMap[Name]['input'],
|
||||
options?: {
|
||||
priority?: number
|
||||
delay?: number
|
||||
attempts?: number
|
||||
removeOnComplete?: number
|
||||
removeOnFail?: number
|
||||
jobId?: string
|
||||
}
|
||||
) => Promise<string>
|
||||
|
||||
type QueueGetJob = <Name extends keyof QueueMap>(
|
||||
name: Name,
|
||||
jobId: string
|
||||
) => Promise<QueueJob<QueueMap[Name]['input'], QueueMap[Name]['output']> | null>
|
||||
|
||||
export type TypedPikkuQueue = {
|
||||
add: QueueAdd;
|
||||
getJob: QueueGetJob;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"pikku-remote-internal-rpc": {
|
||||
"pikkuFuncId": "remoteRPCHandler",
|
||||
"name": "pikku-remote-internal-rpc"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.54
|
||||
*/
|
||||
import { pikkuState } from '@pikku/core/internal'
|
||||
import { QueueWorkersMeta } from '@pikku/core/queue'
|
||||
import metaData from './pikku-queue-workers-wirings-meta.gen.json' with { type: 'json' }
|
||||
|
||||
pikkuState(null, 'queue', 'meta', metaData as QueueWorkersMeta)
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* This file was generated by @pikku/cli@0.12.54
|
||||
*/
|
||||
/* The files with an addQueueWorkers function call */
|
||||
import '../../src/scaffold/rpc-remote.gen.js'
|
||||
Reference in New Issue
Block a user