@pikku/addon-ollama 0.1.5 → 0.1.7
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/dist/.pikku/addon/agent/index.d.ts +1 -1
- package/dist/.pikku/addon/agent/index.js +1 -1
- package/dist/.pikku/addon/agent/index.ts +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts +47 -6
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.js +41 -0
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.js.map +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.ts +42 -1
- package/dist/.pikku/addon/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/addon/agent/pikku-model-aliases.gen.ts +1 -1
- package/dist/.pikku/addon/agent/pikku-scorer-names.gen.d.ts +1 -1
- package/dist/.pikku/addon/analytics/index.d.ts +8 -0
- package/dist/.pikku/addon/analytics/index.d.ts.map +1 -0
- package/dist/.pikku/addon/analytics/index.js +8 -0
- package/dist/.pikku/addon/analytics/index.js.map +1 -0
- package/dist/.pikku/addon/analytics/index.ts +8 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.d.ts +6 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.js +5 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.js.map +1 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.ts +25 -0
- package/dist/.pikku/addon/auth/index.d.ts +1 -1
- package/dist/.pikku/addon/auth/index.js +1 -1
- package/dist/.pikku/addon/auth/index.ts +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts +10 -20
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.js +2 -19
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.js.map +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.ts +10 -20
- package/dist/.pikku/addon/channel/index.d.ts +1 -1
- package/dist/.pikku/addon/channel/index.js +1 -1
- package/dist/.pikku/addon/channel/index.ts +1 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts +10 -20
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.js +7 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.js.map +1 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.ts +8 -18
- package/dist/.pikku/addon/cli/index.d.ts +8 -0
- package/dist/.pikku/addon/cli/index.d.ts.map +1 -0
- package/dist/.pikku/addon/cli/index.js +8 -0
- package/dist/.pikku/addon/cli/index.js.map +1 -0
- package/dist/.pikku/addon/cli/index.ts +8 -0
- package/dist/.pikku/addon/cli/pikku-cli-types.gen.d.ts +62 -0
- package/dist/.pikku/addon/cli/pikku-cli-types.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/cli/pikku-cli-types.gen.js +49 -0
- package/dist/.pikku/addon/cli/pikku-cli-types.gen.js.map +1 -0
- package/dist/.pikku/addon/cli/pikku-cli-types.gen.ts +88 -0
- package/dist/.pikku/addon/db/pikku-db-meta.gen.json +1 -0
- package/dist/.pikku/addon/error/index.d.ts +1 -1
- package/dist/.pikku/addon/error/index.js +1 -1
- package/dist/.pikku/addon/error/index.ts +1 -1
- package/dist/.pikku/addon/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/addon/error/pikku-error-types.gen.ts +1 -1
- package/dist/.pikku/addon/function/index.d.ts +1 -1
- package/dist/.pikku/addon/function/index.js +1 -1
- package/dist/.pikku/addon/function/index.ts +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts +57 -47
- package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.js +21 -9
- package/dist/.pikku/addon/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.ts +56 -44
- package/dist/.pikku/addon/function/pikku-functions-meta-verbose.gen.json +8 -4
- package/dist/.pikku/addon/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/addon/function/pikku-functions-meta.gen.json +4 -0
- package/dist/.pikku/addon/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/addon/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/addon/function/pikku-functions.gen.ts +1 -1
- package/dist/.pikku/addon/http/index.d.ts +1 -1
- package/dist/.pikku/addon/http/index.js +1 -1
- package/dist/.pikku/addon/http/index.ts +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.d.ts +3 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.js.map +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.ts +3 -1
- package/dist/.pikku/addon/mcp/index.d.ts +1 -1
- package/dist/.pikku/addon/mcp/index.js +1 -1
- package/dist/.pikku/addon/mcp/index.ts +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.d.ts +7 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.js.map +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.ts +7 -1
- package/dist/.pikku/addon/middleware/index.d.ts +1 -1
- package/dist/.pikku/addon/middleware/index.js +1 -1
- package/dist/.pikku/addon/middleware/index.ts +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts +42 -26
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.js +29 -24
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.js.map +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.ts +43 -26
- package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.ts +1 -1
- package/dist/.pikku/addon/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/addon/pikku-bootstrap.gen.ts +1 -1
- package/dist/.pikku/addon/pikku-local-services.gen.d.ts +29 -0
- package/dist/.pikku/addon/pikku-local-services.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/pikku-local-services.gen.js +42 -0
- package/dist/.pikku/addon/pikku-local-services.gen.js.map +1 -0
- package/dist/.pikku/addon/pikku-local-services.gen.ts +85 -0
- package/dist/.pikku/addon/pikku-package.gen.js +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +1 -1
- package/dist/.pikku/addon/pikku-services.gen.d.ts +9 -1
- package/dist/.pikku/addon/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-services.gen.js +8 -0
- package/dist/.pikku/addon/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-services.gen.ts +9 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -2
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +2 -2
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +2 -2
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.ts +1 -1
- package/dist/.pikku/addon/scenarios/index.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/index.js +1 -1
- package/dist/.pikku/addon/scenarios/index.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions-meta.gen.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions.gen.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts +53 -35
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.js +7 -3
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.js.map +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.ts +57 -40
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings.gen.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-virtual-users.gen.d.ts +33 -0
- package/dist/.pikku/addon/scenarios/pikku-virtual-users.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/scenarios/pikku-virtual-users.gen.js +29 -0
- package/dist/.pikku/addon/scenarios/pikku-virtual-users.gen.js.map +1 -0
- package/dist/.pikku/addon/scenarios/pikku-virtual-users.gen.ts +52 -0
- package/dist/.pikku/addon/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/schemas/register.gen.ts +1 -1
- package/dist/.pikku/addon/schemas/register.gen.js +1 -1
- package/dist/.pikku/addon/schemas/register.gen.ts +1 -1
- package/dist/.pikku/addon/scopes/index.d.ts +2 -1
- package/dist/.pikku/addon/scopes/index.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/index.js +2 -1
- package/dist/.pikku/addon/scopes/index.js.map +1 -1
- package/dist/.pikku/addon/scopes/index.ts +2 -1
- package/dist/.pikku/addon/scopes/pikku-flags-manifest.gen.d.ts +41 -0
- package/dist/.pikku/addon/scopes/pikku-flags-manifest.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-flags-manifest.gen.js +35 -0
- package/dist/.pikku/addon/scopes/pikku-flags-manifest.gen.js.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-flags-manifest.gen.ts +52 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.d.ts +9 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.js +2 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.js.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.ts +8 -0
- package/dist/.pikku/addon/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-roles.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-roles.gen.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.d.ts +2 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.js +2 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.js.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.ts +2 -1
- package/dist/.pikku/addon/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-scopes.gen.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-virtual-users-meta.gen.json +1 -0
- package/dist/.pikku/addon/scopes/pikku-virtual-users.gen.d.ts +27 -0
- package/dist/.pikku/addon/scopes/pikku-virtual-users.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-virtual-users.gen.js +16 -0
- package/dist/.pikku/addon/scopes/pikku-virtual-users.gen.js.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-virtual-users.gen.ts +39 -0
- package/dist/.pikku/addon/secrets/index.d.ts +1 -1
- package/dist/.pikku/addon/secrets/index.js +1 -1
- package/dist/.pikku/addon/secrets/index.ts +1 -1
- package/dist/.pikku/addon/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/addon/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts +9 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.js +5 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.js.map +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.ts +9 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.ts +1 -1
- package/dist/.pikku/addon/setup/index.d.ts +1 -1
- package/dist/.pikku/addon/setup/index.js +1 -1
- package/dist/.pikku/addon/setup/index.ts +1 -1
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.d.ts +4 -4
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.js +1 -1
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.ts +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts +8 -20
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.js +11 -19
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.js.map +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.ts +19 -19
- package/dist/.pikku/addon/surface-usage.gen.json +326 -26
- package/dist/.pikku/addon/trigger/index.d.ts +1 -1
- package/dist/.pikku/addon/trigger/index.js +1 -1
- package/dist/.pikku/addon/trigger/index.ts +1 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.d.ts +64 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.js +17 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.js.map +1 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.ts +58 -1
- package/dist/.pikku/addon/utils/index.d.ts +8 -0
- package/dist/.pikku/addon/utils/index.d.ts.map +1 -0
- package/dist/.pikku/addon/utils/index.js +8 -0
- package/dist/.pikku/addon/utils/index.js.map +1 -0
- package/dist/.pikku/addon/utils/index.ts +8 -0
- package/dist/.pikku/addon/utils/pikku-utils-types.gen.d.ts +5 -0
- package/dist/.pikku/addon/utils/pikku-utils-types.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/utils/pikku-utils-types.gen.js +5 -0
- package/dist/.pikku/addon/utils/pikku-utils-types.gen.js.map +1 -0
- package/dist/.pikku/addon/utils/pikku-utils-types.gen.ts +4 -0
- package/dist/.pikku/addon/variables/index.d.ts +1 -1
- package/dist/.pikku/addon/variables/index.js +1 -1
- package/dist/.pikku/addon/variables/index.ts +1 -1
- package/dist/.pikku/addon/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/addon/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts +9 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.js +7 -2
- package/dist/.pikku/addon/variables/pikku-variables.gen.js.map +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.ts +10 -2
- package/dist/.pikku/addon/webhooks/pikku-outgoing-webhooks-meta.gen.json +1 -0
- package/dist/.pikku/addon/webhooks/pikku-outgoing-webhooks.gen.d.ts +12 -0
- package/dist/.pikku/addon/webhooks/pikku-outgoing-webhooks.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/webhooks/pikku-outgoing-webhooks.gen.js +3 -0
- package/dist/.pikku/addon/webhooks/pikku-outgoing-webhooks.gen.js.map +1 -0
- package/dist/.pikku/addon/webhooks/pikku-outgoing-webhooks.gen.ts +15 -0
- package/dist/.pikku/addon/workflow/index.d.ts +1 -1
- package/dist/.pikku/addon/workflow/index.js +1 -1
- package/dist/.pikku/addon/workflow/index.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-scenario-step-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.d.ts +30 -6
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.js +8 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.ts +33 -2
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/.pikku/addon/workflow/virtual-users.gen.json +1 -0
- package/dist/.pikku/runs/mvcet6cm.all.jsonl +3 -0
- package/dist/src/functions/embeddings/embed-many.function.d.ts +3 -3
- package/dist/src/functions/embeddings/embed-many.function.d.ts.map +1 -1
- package/dist/src/functions/embeddings/embed.function.d.ts +3 -3
- package/dist/src/functions/embeddings/embed.function.d.ts.map +1 -1
- package/dist/src/functions/text/generate-object.function.d.ts +15 -15
- package/dist/src/functions/text/generate-object.function.d.ts.map +1 -1
- package/dist/src/functions/text/generate.function.d.ts +8 -8
- package/dist/src/functions/text/generate.function.d.ts.map +1 -1
- package/package.json +14 -11
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.d.ts +0 -18
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.d.ts.map +0 -1
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.js +0 -18
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.js.map +0 -1
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.ts +0 -36
- package/dist/.pikku/addon/scopes/pikku-personas.gen.d.ts +0 -29
- package/dist/.pikku/addon/scopes/pikku-personas.gen.d.ts.map +0 -1
- package/dist/.pikku/addon/scopes/pikku-personas.gen.js +0 -18
- package/dist/.pikku/addon/scopes/pikku-personas.gen.js.map +0 -1
- package/dist/.pikku/addon/scopes/pikku-personas.gen.ts +0 -41
- /package/dist/.pikku/addon/{scopes/pikku-personas-meta.gen.json → analytics/pikku-analytics-meta.gen.json} +0 -0
- /package/dist/.pikku/addon/{workflow/personas.gen.json → scopes/pikku-flags-meta.gen.json} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.190
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* HTTP-specific type definitions for tree-shaking optimization
|
|
@@ -41,6 +41,8 @@ type TypedHTTPRoutesGroupConfig = {
|
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* Type-safe helper for defining route contracts that can be composed.
|
|
44
|
+
*
|
|
45
|
+
* @example snippet: wireHttp
|
|
44
46
|
*/
|
|
45
47
|
export declare function defineHTTPRoutes<T extends TypedHTTPRouteMap>(routes: T): TypedHTTPRouteContract<T>;
|
|
46
48
|
export declare function defineHTTPRoutes<T extends TypedHTTPRouteMap>(config: TypedHTTPRoutesGroupConfig & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-http-types.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/http/pikku-http-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAClF,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACpB,MAAM,kBAAkB,CAAA;AAGzB;;GAEG;AACH,KAAK,eAAe,GAAG,mBAAmB,GAAG;IAC3C,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACvD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,UAAU,CAAC,EAAE,eAAe,EAAE,CAAA;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAA;CACd,CAAA;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,iBAAiB,GAAG,sBAAsB,CAAA;CAC5E,CAAA;AAED;;GAEG;AACH,KAAK,sBAAsB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,IAAI,0BAA0B,GAAG;IAC1G,MAAM,EAAE,CAAC,CAAA;CACV,CAAA;AAED;;GAEG;AACH,KAAK,0BAA0B,GAAG;IAChC,QAAQ,CAAC,EAAE,MAAM,CA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AC,EAAE,eAAe,EAAE,CAAA;CAC/B,CAAA;AAGD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,EAAE,MAAM,EAAE,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAA;AACnG,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,EAAE,MAAM,EAAE,0BAA0B,GAAG;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-http-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/http/pikku-http-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"pikku-http-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/http/pikku-http-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAqD3E,MAAM,UAAU,gBAAgB,CAA8B,cAAgE;IAC5H,OAAO,oBAAoB,CAAC,cAAqB,CAAyC,CAAA;AAC5F,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.190
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* HTTP-specific type definitions for tree-shaking optimization
|
|
@@ -53,6 +53,8 @@ type TypedHTTPRoutesGroupConfig = {
|
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Type-safe helper for defining route contracts that can be composed.
|
|
56
|
+
*
|
|
57
|
+
* @example snippet: wireHttp
|
|
56
58
|
*/
|
|
57
59
|
export function defineHTTPRoutes<T extends TypedHTTPRouteMap>(routes: T): TypedHTTPRouteContract<T>
|
|
58
60
|
export function defineHTTPRoutes<T extends TypedHTTPRouteMap>(config: TypedHTTPRoutesGroupConfig & { routes: T }): TypedHTTPRouteContract<T>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.190
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* MCP-specific type definitions for tree-shaking optimization
|
|
@@ -30,6 +30,8 @@ type MCPPromptFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
|
|
|
30
30
|
* @template In - Input type for the prompt parameters (inferred from schema if provided)
|
|
31
31
|
* @param func - Function definition, either direct function or configuration object
|
|
32
32
|
* @returns The unwrapped function for internal use
|
|
33
|
+
*
|
|
34
|
+
* @example snippet: mcpPrompt
|
|
33
35
|
*/
|
|
34
36
|
export declare function pikkuMCPPromptFunc<InputSchema extends StandardSchemaV1>(config: MCPPromptFuncConfigWithSchema<InputSchema>): PikkuFunctionConfig<InferSchemaOutput<InputSchema>, MCPPromptResponse, 'mcp' | 'rpc'>;
|
|
35
37
|
export declare function pikkuMCPPromptFunc<In>(func: PikkuFunctionSessionless<In, MCPPromptResponse, 'mcp' | 'rpc'> | {
|
|
@@ -61,6 +63,8 @@ type MCPToolFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
|
|
|
61
63
|
* @template In - Input type for the tool invocation (inferred from schema if provided)
|
|
62
64
|
* @param func - Function definition, either direct function or configuration object
|
|
63
65
|
* @returns The unwrapped function for internal use
|
|
66
|
+
*
|
|
67
|
+
* @example snippet: mcpSingleTool
|
|
64
68
|
*/
|
|
65
69
|
export declare function pikkuMCPToolFunc<InputSchema extends StandardSchemaV1>(config: MCPToolFuncConfigWithSchema<InputSchema>): PikkuFunctionConfig<InferSchemaOutput<InputSchema>, MCPToolResponse, 'mcp' | 'rpc'>;
|
|
66
70
|
export declare function pikkuMCPToolFunc<In>(func: PikkuFunctionSessionless<In, MCPToolResponse, 'mcp' | 'rpc'> | {
|
|
@@ -92,6 +96,8 @@ type MCPResourceFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
|
|
|
92
96
|
* @template In - Input type for the resource request (inferred from schema if provided)
|
|
93
97
|
* @param func - Function definition, either direct function or configuration object
|
|
94
98
|
* @returns The unwrapped function for internal use
|
|
99
|
+
*
|
|
100
|
+
* @example snippet: mcpResource
|
|
95
101
|
*/
|
|
96
102
|
export declare function pikkuMCPResourceFunc<InputSchema extends StandardSchemaV1>(config: MCPResourceFuncConfigWithSchema<InputSchema>): PikkuFunctionConfig<InferSchemaOutput<InputSchema>, MCPResourceResponse, 'mcp' | 'rpc'>;
|
|
97
103
|
export declare function pikkuMCPResourceFunc<In>(func: PikkuFunctionSessionless<In, MCPResourceResponse, 'mcp' | 'rpc'> | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-mcp-types.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/mcp/pikku-mcp-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EACL,eAAe,EAChB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC/H,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAI7D;;GAEG;AACH,KAAK,6BAA6B,CAAC,WAAW,SAAS,gBAAgB,IAAI;IAC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AAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-mcp-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/mcp/pikku-mcp-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;
|
|
1
|
+
{"version":3,"file":"pikku-mcp-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/mcp/pikku-mcp-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAiDH,MAAM,UAAU,kBAAkB,CAAC,IAAS;IAC1C,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC;AAgDD,MAAM,UAAU,gBAAgB,CAAC,IAAS;IACxC,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC;AAoCD,MAAM,UAAU,oBAAoB,CAAC,IAAS;IAC5C,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACrD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.190
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* MCP-specific type definitions for tree-shaking optimization
|
|
@@ -38,6 +38,8 @@ type MCPPromptFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
|
|
|
38
38
|
* @template In - Input type for the prompt parameters (inferred from schema if provided)
|
|
39
39
|
* @param func - Function definition, either direct function or configuration object
|
|
40
40
|
* @returns The unwrapped function for internal use
|
|
41
|
+
*
|
|
42
|
+
* @example snippet: mcpPrompt
|
|
41
43
|
*/
|
|
42
44
|
export function pikkuMCPPromptFunc<InputSchema extends StandardSchemaV1>(
|
|
43
45
|
config: MCPPromptFuncConfigWithSchema<InputSchema>
|
|
@@ -80,6 +82,8 @@ type MCPToolFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
|
|
|
80
82
|
* @template In - Input type for the tool invocation (inferred from schema if provided)
|
|
81
83
|
* @param func - Function definition, either direct function or configuration object
|
|
82
84
|
* @returns The unwrapped function for internal use
|
|
85
|
+
*
|
|
86
|
+
* @example snippet: mcpSingleTool
|
|
83
87
|
*/
|
|
84
88
|
export function pikkuMCPToolFunc<InputSchema extends StandardSchemaV1>(
|
|
85
89
|
config: MCPToolFuncConfigWithSchema<InputSchema>
|
|
@@ -122,6 +126,8 @@ type MCPResourceFuncConfigWithSchema<InputSchema extends StandardSchemaV1> = {
|
|
|
122
126
|
* @template In - Input type for the resource request (inferred from schema if provided)
|
|
123
127
|
* @param func - Function definition, either direct function or configuration object
|
|
124
128
|
* @returns The unwrapped function for internal use
|
|
129
|
+
*
|
|
130
|
+
* @example snippet: mcpResource
|
|
125
131
|
*/
|
|
126
132
|
export function pikkuMCPResourceFunc<InputSchema extends StandardSchemaV1>(
|
|
127
133
|
config: MCPResourceFuncConfigWithSchema<InputSchema>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.190
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Middleware type definitions and registration for all wirings
|
|
@@ -7,9 +7,16 @@
|
|
|
7
7
|
import type { CorePikkuMiddleware, MiddlewarePriority } from '@pikku/core/middleware';
|
|
8
8
|
import { CorePikkuChannelMiddleware, CorePikkuChannelMiddlewareFactory } from '@pikku/core/channel';
|
|
9
9
|
import type { PikkuAgentMiddlewareHooks } from '@pikku/core/agent';
|
|
10
|
-
import type { Services, SingletonServices
|
|
11
|
-
|
|
10
|
+
import type { Services, SingletonServices } from '../function/pikku-function-types.gen.js';
|
|
11
|
+
import type { RequiredSingletonServices } from '../pikku-services.gen.js';
|
|
12
|
+
export { cors, requireOrigin, authAPIKey, authBearer, authCookie } from '@pikku/core/middleware';
|
|
12
13
|
export type { MiddlewarePriority };
|
|
14
|
+
/**
|
|
15
|
+
* Derived here rather than imported: nothing outside a generated leaf ever
|
|
16
|
+
* names this intersection, so the function leaf keeps it to itself and the
|
|
17
|
+
* leaves that want it spell it out.
|
|
18
|
+
*/
|
|
19
|
+
type WiredSingletonServices = RequiredSingletonServices & SingletonServices;
|
|
13
20
|
/**
|
|
14
21
|
* Type-safe middleware definition that can access your application's services and session.
|
|
15
22
|
* Use this to define reusable middleware that can be applied to multiple wirings.
|
|
@@ -59,18 +66,7 @@ export declare const pikkuMiddleware: <RequiredServices extends SingletonService
|
|
|
59
66
|
* Factory function for creating middleware factories
|
|
60
67
|
* Use this when your middleware needs configuration/input parameters
|
|
61
68
|
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```typescript
|
|
64
|
-
* export const logMiddleware = pikkuMiddlewareFactory<LogOptions>(({
|
|
65
|
-
* message,
|
|
66
|
-
* level = 'info'
|
|
67
|
-
* }) => {
|
|
68
|
-
* return pikkuMiddleware(async ({ logger }, next) => {
|
|
69
|
-
* logger[level](message)
|
|
70
|
-
* await next()
|
|
71
|
-
* })
|
|
72
|
-
* })
|
|
73
|
-
* ```
|
|
69
|
+
* @example snippet: middlewareFactory
|
|
74
70
|
*/
|
|
75
71
|
export declare const pikkuMiddlewareFactory: <In = any>(factory: (input: In) => PikkuMiddleware) => ((input: In) => PikkuMiddleware);
|
|
76
72
|
/**
|
|
@@ -86,8 +82,7 @@ export declare const addGlobalMiddleware: (middleware: PikkuMiddleware[]) => voi
|
|
|
86
82
|
/**
|
|
87
83
|
* Tag-scoped middleware. Applies to any wiring that carries the matching tag.
|
|
88
84
|
*
|
|
89
|
-
* @example
|
|
90
|
-
* addTagMiddleware('admin', [adminMiddleware])
|
|
85
|
+
* @example snippet: tagMiddleware
|
|
91
86
|
*/
|
|
92
87
|
export declare const addTagMiddleware: (tag: string, middleware: PikkuMiddleware[]) => void;
|
|
93
88
|
/**
|
|
@@ -100,19 +95,40 @@ export declare const addTagMiddleware: (tag: string, middleware: PikkuMiddleware
|
|
|
100
95
|
* @param routeOrMiddleware - Either a global middleware array or a route pattern string
|
|
101
96
|
* @param middleware - The middleware array to apply when a route pattern is specified
|
|
102
97
|
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```typescript
|
|
105
|
-
* // Add global HTTP middleware
|
|
106
|
-
* addHTTPMiddleware([authMiddleware, loggingMiddleware])
|
|
107
|
-
*
|
|
108
|
-
* // Add route-specific middleware
|
|
109
|
-
* addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
|
|
110
|
-
* ```
|
|
98
|
+
* @example snippet: httpMiddleware
|
|
111
99
|
*/
|
|
112
100
|
export declare const addHTTPMiddleware: (routeOrMiddleware: PikkuMiddleware[] | string, middleware?: PikkuMiddleware[]) => void;
|
|
101
|
+
/**
|
|
102
|
+
* The shape of channel middleware — it runs around the connection and its
|
|
103
|
+
* messages rather than around a single request.
|
|
104
|
+
*/
|
|
113
105
|
export type PikkuChannelMiddleware<RequiredServices extends Services = Services, Event = unknown> = CorePikkuChannelMiddleware<RequiredServices, Event>;
|
|
106
|
+
/**
|
|
107
|
+
* Declares middleware for a channel — it runs around the connection and its
|
|
108
|
+
* messages rather than around a single request.
|
|
109
|
+
*
|
|
110
|
+
* @example snippet: channelMiddleware
|
|
111
|
+
*/
|
|
114
112
|
export declare const pikkuChannelMiddleware: <RequiredServices extends Services = Services, Event = unknown>(middleware: PikkuChannelMiddleware<RequiredServices, Event>) => PikkuChannelMiddleware<RequiredServices, Event>;
|
|
113
|
+
/**
|
|
114
|
+
* Declares channel middleware that takes options, so one definition can be
|
|
115
|
+
* wired several times with different configuration.
|
|
116
|
+
*
|
|
117
|
+
* @example snippet: channelMiddlewareFactory
|
|
118
|
+
*/
|
|
115
119
|
export declare const pikkuChannelMiddlewareFactory: <In = any>(factory: CorePikkuChannelMiddlewareFactory<In>) => CorePikkuChannelMiddlewareFactory<In>;
|
|
120
|
+
/**
|
|
121
|
+
* Attaches channel middleware to every channel carrying the given tag, so the
|
|
122
|
+
* channels themselves stay free of the wiring.
|
|
123
|
+
*
|
|
124
|
+
* @example snippet: addChannelMiddleware
|
|
125
|
+
*/
|
|
116
126
|
export declare const addChannelMiddleware: (tag: string, middleware: PikkuChannelMiddleware[]) => CorePikkuChannelMiddleware[];
|
|
117
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Declares middleware for an agent run — hooks around the model call, its tool
|
|
129
|
+
* calls and the run's state.
|
|
130
|
+
*
|
|
131
|
+
* @example snippet: agentMiddleware
|
|
132
|
+
*/
|
|
133
|
+
export declare const pikkuAgentMiddleware: <State extends Record<string, unknown> = Record<string, unknown>, RequiredServices extends SingletonServices = WiredSingletonServices>(hooks: PikkuAgentMiddlewareHooks<State, RequiredServices>) => PikkuAgentMiddlewareHooks<State, RequiredServices>;
|
|
118
134
|
//# sourceMappingURL=pikku-middleware-types.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-middleware-types.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/middleware/pikku-middleware-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAGrF,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EAElC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"pikku-middleware-types.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/middleware/pikku-middleware-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,O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,CAAC,KAAK,EAAE,gBAAgB,CAAU,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.190
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Middleware type definitions and registration for all wirings
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { addTagMiddleware as addTagMiddlewareCore, addGlobalMiddleware as addGlobalMiddlewareCore, pikkuMiddleware as pikkuMiddlewareCore } from '@pikku/core/middleware';
|
|
8
8
|
import { addHTTPMiddleware as addHTTPMiddlewareCore } from '@pikku/core/http';
|
|
9
9
|
import { addChannelMiddleware as addChannelMiddlewareCore, } from '@pikku/core/channel';
|
|
10
|
-
export { cors } from '@pikku/core/middleware';
|
|
10
|
+
export { cors, requireOrigin, authAPIKey, authBearer, authCookie } from '@pikku/core/middleware';
|
|
11
11
|
/**
|
|
12
12
|
* Factory function for creating middleware with tree-shaking support.
|
|
13
13
|
* Supports both direct function and configuration object syntax.
|
|
@@ -39,18 +39,7 @@ export const pikkuMiddleware = (middleware) => {
|
|
|
39
39
|
* Factory function for creating middleware factories
|
|
40
40
|
* Use this when your middleware needs configuration/input parameters
|
|
41
41
|
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* export const logMiddleware = pikkuMiddlewareFactory<LogOptions>(({
|
|
45
|
-
* message,
|
|
46
|
-
* level = 'info'
|
|
47
|
-
* }) => {
|
|
48
|
-
* return pikkuMiddleware(async ({ logger }, next) => {
|
|
49
|
-
* logger[level](message)
|
|
50
|
-
* await next()
|
|
51
|
-
* })
|
|
52
|
-
* })
|
|
53
|
-
* ```
|
|
42
|
+
* @example snippet: middlewareFactory
|
|
54
43
|
*/
|
|
55
44
|
export const pikkuMiddlewareFactory = (factory) => {
|
|
56
45
|
return factory;
|
|
@@ -70,8 +59,7 @@ export const addGlobalMiddleware = (middleware) => {
|
|
|
70
59
|
/**
|
|
71
60
|
* Tag-scoped middleware. Applies to any wiring that carries the matching tag.
|
|
72
61
|
*
|
|
73
|
-
* @example
|
|
74
|
-
* addTagMiddleware('admin', [adminMiddleware])
|
|
62
|
+
* @example snippet: tagMiddleware
|
|
75
63
|
*/
|
|
76
64
|
export const addTagMiddleware = (tag, middleware) => {
|
|
77
65
|
addTagMiddlewareCore(tag, middleware, '@pikku/addon-ollama');
|
|
@@ -86,24 +74,41 @@ export const addTagMiddleware = (tag, middleware) => {
|
|
|
86
74
|
* @param routeOrMiddleware - Either a global middleware array or a route pattern string
|
|
87
75
|
* @param middleware - The middleware array to apply when a route pattern is specified
|
|
88
76
|
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```typescript
|
|
91
|
-
* // Add global HTTP middleware
|
|
92
|
-
* addHTTPMiddleware([authMiddleware, loggingMiddleware])
|
|
93
|
-
*
|
|
94
|
-
* // Add route-specific middleware
|
|
95
|
-
* addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
|
|
96
|
-
* ```
|
|
77
|
+
* @example snippet: httpMiddleware
|
|
97
78
|
*/
|
|
98
79
|
export const addHTTPMiddleware = (routeOrMiddleware, middleware) => {
|
|
99
80
|
addHTTPMiddlewareCore(routeOrMiddleware, middleware);
|
|
100
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Declares middleware for a channel — it runs around the connection and its
|
|
84
|
+
* messages rather than around a single request.
|
|
85
|
+
*
|
|
86
|
+
* @example snippet: channelMiddleware
|
|
87
|
+
*/
|
|
101
88
|
export const pikkuChannelMiddleware = (middleware) => {
|
|
102
89
|
return middleware;
|
|
103
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Declares channel middleware that takes options, so one definition can be
|
|
93
|
+
* wired several times with different configuration.
|
|
94
|
+
*
|
|
95
|
+
* @example snippet: channelMiddlewareFactory
|
|
96
|
+
*/
|
|
104
97
|
export const pikkuChannelMiddlewareFactory = (factory) => {
|
|
105
98
|
return factory;
|
|
106
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Attaches channel middleware to every channel carrying the given tag, so the
|
|
102
|
+
* channels themselves stay free of the wiring.
|
|
103
|
+
*
|
|
104
|
+
* @example snippet: addChannelMiddleware
|
|
105
|
+
*/
|
|
107
106
|
export const addChannelMiddleware = (tag, middleware) => addChannelMiddlewareCore(tag, middleware, '@pikku/addon-ollama');
|
|
107
|
+
/**
|
|
108
|
+
* Declares middleware for an agent run — hooks around the model call, its tool
|
|
109
|
+
* calls and the run's state.
|
|
110
|
+
*
|
|
111
|
+
* @example snippet: agentMiddleware
|
|
112
|
+
*/
|
|
108
113
|
export const pikkuAgentMiddleware = (hooks) => hooks;
|
|
109
114
|
//# sourceMappingURL=pikku-middleware-types.gen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pikku-middleware-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/middleware/pikku-middleware-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAGH,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACzK,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAGL,oBAAoB,IAAI,wBAAwB,GACjD,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"pikku-middleware-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/middleware/pikku-middleware-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAGH,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACzK,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAGL,oBA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GAAW,EAAE,UAAoC,EAAE,EAAE,CACxF,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAA;AAElE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAIlC,KAAyD,EACL,EAAE,CAAC,KAAK,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.190
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Middleware type definitions and registration for all wirings
|
|
@@ -14,11 +14,19 @@ import {
|
|
|
14
14
|
addChannelMiddleware as addChannelMiddlewareCore,
|
|
15
15
|
} from '@pikku/core/channel'
|
|
16
16
|
import type { PikkuAgentMiddlewareHooks } from '@pikku/core/agent'
|
|
17
|
-
import type { Services, SingletonServices
|
|
17
|
+
import type { Services, SingletonServices } from '../function/pikku-function-types.gen.js'
|
|
18
|
+
import type { RequiredSingletonServices } from '../pikku-services.gen.js'
|
|
18
19
|
|
|
19
|
-
export { cors } from '@pikku/core/middleware'
|
|
20
|
+
export { cors, requireOrigin, authAPIKey, authBearer, authCookie } from '@pikku/core/middleware'
|
|
20
21
|
export type { MiddlewarePriority }
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Derived here rather than imported: nothing outside a generated leaf ever
|
|
25
|
+
* names this intersection, so the function leaf keeps it to itself and the
|
|
26
|
+
* leaves that want it spell it out.
|
|
27
|
+
*/
|
|
28
|
+
type WiredSingletonServices = RequiredSingletonServices & SingletonServices
|
|
29
|
+
|
|
22
30
|
/**
|
|
23
31
|
* Type-safe middleware definition that can access your application's services and session.
|
|
24
32
|
* Use this to define reusable middleware that can be applied to multiple wirings.
|
|
@@ -75,18 +83,7 @@ export const pikkuMiddleware = <RequiredServices extends SingletonServices = Wir
|
|
|
75
83
|
* Factory function for creating middleware factories
|
|
76
84
|
* Use this when your middleware needs configuration/input parameters
|
|
77
85
|
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```typescript
|
|
80
|
-
* export const logMiddleware = pikkuMiddlewareFactory<LogOptions>(({
|
|
81
|
-
* message,
|
|
82
|
-
* level = 'info'
|
|
83
|
-
* }) => {
|
|
84
|
-
* return pikkuMiddleware(async ({ logger }, next) => {
|
|
85
|
-
* logger[level](message)
|
|
86
|
-
* await next()
|
|
87
|
-
* })
|
|
88
|
-
* })
|
|
89
|
-
* ```
|
|
86
|
+
* @example snippet: middlewareFactory
|
|
90
87
|
*/
|
|
91
88
|
export const pikkuMiddlewareFactory = <In = any>(
|
|
92
89
|
factory: (input: In) => PikkuMiddleware
|
|
@@ -110,8 +107,7 @@ export const addGlobalMiddleware = (middleware: PikkuMiddleware[]) => {
|
|
|
110
107
|
/**
|
|
111
108
|
* Tag-scoped middleware. Applies to any wiring that carries the matching tag.
|
|
112
109
|
*
|
|
113
|
-
* @example
|
|
114
|
-
* addTagMiddleware('admin', [adminMiddleware])
|
|
110
|
+
* @example snippet: tagMiddleware
|
|
115
111
|
*/
|
|
116
112
|
export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) => {
|
|
117
113
|
addTagMiddlewareCore(tag, middleware as any, '@pikku/addon-ollama')
|
|
@@ -126,14 +122,7 @@ export const addTagMiddleware = (tag: string, middleware: PikkuMiddleware[]) =>
|
|
|
126
122
|
* @param routeOrMiddleware - Either a global middleware array or a route pattern string
|
|
127
123
|
* @param middleware - The middleware array to apply when a route pattern is specified
|
|
128
124
|
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```typescript
|
|
131
|
-
* // Add global HTTP middleware
|
|
132
|
-
* addHTTPMiddleware([authMiddleware, loggingMiddleware])
|
|
133
|
-
*
|
|
134
|
-
* // Add route-specific middleware
|
|
135
|
-
* addHTTPMiddleware('/api/admin/*', [adminAuthMiddleware])
|
|
136
|
-
* ```
|
|
125
|
+
* @example snippet: httpMiddleware
|
|
137
126
|
*/
|
|
138
127
|
export const addHTTPMiddleware = (
|
|
139
128
|
routeOrMiddleware: PikkuMiddleware[] | string,
|
|
@@ -142,26 +131,54 @@ export const addHTTPMiddleware = (
|
|
|
142
131
|
addHTTPMiddlewareCore(routeOrMiddleware as any, middleware as any)
|
|
143
132
|
}
|
|
144
133
|
|
|
134
|
+
/**
|
|
135
|
+
* The shape of channel middleware — it runs around the connection and its
|
|
136
|
+
* messages rather than around a single request.
|
|
137
|
+
*/
|
|
145
138
|
export type PikkuChannelMiddleware<RequiredServices extends Services = Services, Event = unknown> = CorePikkuChannelMiddleware<RequiredServices, Event>
|
|
146
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Declares middleware for a channel — it runs around the connection and its
|
|
142
|
+
* messages rather than around a single request.
|
|
143
|
+
*
|
|
144
|
+
* @example snippet: channelMiddleware
|
|
145
|
+
*/
|
|
147
146
|
export const pikkuChannelMiddleware = <RequiredServices extends Services = Services, Event = unknown>(
|
|
148
147
|
middleware: PikkuChannelMiddleware<RequiredServices, Event>
|
|
149
148
|
): PikkuChannelMiddleware<RequiredServices, Event> => {
|
|
150
149
|
return middleware
|
|
151
150
|
}
|
|
152
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Declares channel middleware that takes options, so one definition can be
|
|
154
|
+
* wired several times with different configuration.
|
|
155
|
+
*
|
|
156
|
+
* @example snippet: channelMiddlewareFactory
|
|
157
|
+
*/
|
|
153
158
|
export const pikkuChannelMiddlewareFactory = <In = any>(
|
|
154
159
|
factory: CorePikkuChannelMiddlewareFactory<In>
|
|
155
160
|
): CorePikkuChannelMiddlewareFactory<In> => {
|
|
156
161
|
return factory
|
|
157
162
|
}
|
|
158
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Attaches channel middleware to every channel carrying the given tag, so the
|
|
166
|
+
* channels themselves stay free of the wiring.
|
|
167
|
+
*
|
|
168
|
+
* @example snippet: addChannelMiddleware
|
|
169
|
+
*/
|
|
159
170
|
export const addChannelMiddleware = (tag: string, middleware: PikkuChannelMiddleware[]) =>
|
|
160
171
|
addChannelMiddlewareCore(tag, middleware, '@pikku/addon-ollama')
|
|
161
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Declares middleware for an agent run — hooks around the model call, its tool
|
|
175
|
+
* calls and the run's state.
|
|
176
|
+
*
|
|
177
|
+
* @example snippet: agentMiddleware
|
|
178
|
+
*/
|
|
162
179
|
export const pikkuAgentMiddleware = <
|
|
163
180
|
State extends Record<string, unknown> = Record<string, unknown>,
|
|
164
|
-
RequiredServices extends
|
|
181
|
+
RequiredServices extends SingletonServices = WiredSingletonServices,
|
|
165
182
|
>(
|
|
166
183
|
hooks: PikkuAgentMiddlewareHooks<State, RequiredServices>
|
|
167
184
|
): PikkuAgentMiddlewareHooks<State, RequiredServices> => hooks
|