@pikku/core 0.12.80 → 0.12.83
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/CHANGELOG.md +345 -0
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/function/function-runner.js +2 -5
- package/dist/function/index.d.ts +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +3 -3
- package/dist/pikku-state.js +4 -0
- package/dist/services/ai-agent-runner-service.d.ts +7 -0
- package/dist/services/ai-run-state-service.d.ts +10 -0
- package/dist/services/in-memory-ai-run-state-service.d.ts +5 -1
- package/dist/services/in-memory-ai-run-state-service.js +9 -0
- package/dist/services/index.d.ts +15 -16
- package/dist/services/index.js +5 -5
- package/dist/services/meta-service.d.ts +2 -1
- package/dist/services/scoped-credential-service.d.ts +21 -0
- package/dist/services/scoped-credential-service.js +53 -0
- package/dist/testing/service-tests/ai-storage-service-tests.js +76 -0
- package/dist/types/core.types.d.ts +2 -3
- package/dist/types/state.types.d.ts +19 -1
- package/dist/wirings/actor-flow/index.d.ts +1 -1
- package/dist/wirings/ai-agent/ai-agent-finalize.d.ts +58 -0
- package/dist/wirings/ai-agent/ai-agent-finalize.js +138 -0
- package/dist/wirings/ai-agent/ai-agent-interrupt.js +1 -0
- package/dist/wirings/ai-agent/ai-agent-memory.d.ts +2 -8
- package/dist/wirings/ai-agent/ai-agent-memory.js +34 -17
- package/dist/wirings/ai-agent/ai-agent-model-config.d.ts +7 -0
- package/dist/wirings/ai-agent/ai-agent-model-config.js +44 -1
- package/dist/wirings/ai-agent/ai-agent-prepare.js +4 -0
- package/dist/wirings/ai-agent/ai-agent-runner.js +61 -40
- package/dist/wirings/ai-agent/ai-agent-stream.js +89 -36
- package/dist/wirings/ai-agent/ai-agent-turn.d.ts +1 -0
- package/dist/wirings/ai-agent/ai-agent-turn.js +1 -0
- package/dist/wirings/ai-agent/ai-agent.types.d.ts +46 -1
- package/dist/wirings/ai-agent/index.d.ts +8 -7
- package/dist/wirings/ai-agent/index.js +5 -4
- package/dist/wirings/ai-scorer/ai-scorer-grade.d.ts +26 -0
- package/dist/wirings/ai-scorer/ai-scorer-grade.js +33 -0
- package/dist/wirings/ai-scorer/ai-scorer-judge.d.ts +17 -0
- package/dist/wirings/ai-scorer/ai-scorer-judge.js +92 -0
- package/dist/wirings/ai-scorer/ai-scorer-live.d.ts +15 -0
- package/dist/wirings/ai-scorer/ai-scorer-live.js +38 -0
- package/dist/wirings/ai-scorer/ai-scorer-registry.d.ts +18 -0
- package/dist/wirings/ai-scorer/ai-scorer-registry.js +46 -0
- package/dist/wirings/ai-scorer/ai-scorer-sampling.d.ts +8 -0
- package/dist/wirings/ai-scorer/ai-scorer-sampling.js +31 -0
- package/dist/wirings/ai-scorer/ai-scorer-snapshots.d.ts +10 -0
- package/dist/wirings/ai-scorer/ai-scorer-snapshots.js +40 -0
- package/dist/wirings/ai-scorer/ai-scorer-worker.d.ts +15 -0
- package/dist/wirings/ai-scorer/ai-scorer-worker.js +58 -0
- package/dist/wirings/ai-scorer/ai-scorer.d.ts +39 -0
- package/dist/wirings/ai-scorer/ai-scorer.js +40 -0
- package/dist/wirings/ai-scorer/ai-scorer.types.d.ts +90 -0
- package/dist/wirings/ai-scorer/ai-scorer.types.js +4 -0
- package/dist/wirings/ai-scorer/index.d.ts +6 -0
- package/dist/wirings/ai-scorer/index.js +5 -0
- package/dist/wirings/channel/index.d.ts +5 -6
- package/dist/wirings/channel/index.js +3 -4
- package/dist/wirings/channel/local/local-channel-runner.js +8 -1
- package/dist/wirings/cli/channel/cli-raw-channel-runner.js +9 -1
- package/dist/wirings/cli/channel/index.d.ts +1 -2
- package/dist/wirings/cli/channel/index.js +0 -1
- package/dist/wirings/cli/cli-runner.js +13 -1
- package/dist/wirings/credential/index.d.ts +1 -1
- package/dist/wirings/gateway/index.d.ts +1 -1
- package/dist/wirings/http/http-runner.js +8 -2
- package/dist/wirings/http/index.d.ts +1 -2
- package/dist/wirings/mcp/index.d.ts +1 -1
- package/dist/wirings/mcp/mcp-runner.d.ts +15 -0
- package/dist/wirings/mcp/mcp-runner.js +18 -5
- package/dist/wirings/persona/index.d.ts +3 -4
- package/dist/wirings/persona/index.js +2 -3
- package/dist/wirings/queue/index.d.ts +1 -3
- package/dist/wirings/queue/index.js +1 -3
- package/dist/wirings/rpc/addon-runner.d.ts +8 -0
- package/dist/wirings/rpc/addon-runner.js +31 -3
- package/dist/wirings/rpc/rpc-runner.js +4 -0
- package/dist/wirings/rpc/rpc-types.d.ts +8 -0
- package/dist/wirings/rpc/wire-addon.d.ts +25 -0
- package/dist/wirings/rpc/wire-addon.js +8 -0
- package/dist/wirings/scheduler/index.d.ts +1 -1
- package/dist/wirings/trigger/index.d.ts +1 -1
- package/dist/wirings/virtual-user/index.d.ts +5 -6
- package/dist/wirings/virtual-user/index.js +2 -4
- package/dist/wirings/workflow/dsl/workflow-dsl.types.d.ts +85 -15
- package/dist/wirings/workflow/feature.d.ts +2 -1
- package/dist/wirings/workflow/index.d.ts +5 -16
- package/dist/wirings/workflow/index.js +1 -9
- package/dist/wirings/workflow/pikku-scenario-service.d.ts +17 -7
- package/dist/wirings/workflow/pikku-scenario-service.js +48 -13
- package/dist/wirings/workflow/pikku-workflow-service.js +17 -3
- package/dist/wirings/workflow/scenario-step.types.d.ts +8 -0
- package/dist/wirings/workflow/scenario.types.d.ts +37 -0
- package/dist/wirings/workflow/workflow-approval-audit.d.ts +16 -0
- package/dist/wirings/workflow/workflow-approval-audit.js +40 -0
- package/dist/wirings/workflow/workflow-approval-policy.d.ts +20 -0
- package/dist/wirings/workflow/workflow-approval-policy.js +48 -0
- package/dist/wirings/workflow/workflow-approval.d.ts +29 -1
- package/dist/wirings/workflow/workflow-approval.js +65 -2
- package/dist/wirings/workflow/workflow-run-ownership.d.ts +2 -1
- package/dist/wirings/workflow/workflow-run-ownership.js +2 -1
- package/dist/wirings/workflow/workflow.types.d.ts +2 -37
- package/knowledge/decisions/internals/addon-pikku-meta-ships-at-the-package-root-or-under-dist.md +32 -0
- package/knowledge/decisions/internals/an-addon-scope-root-loses-to-a-root-the-host-already-declares.md +39 -0
- package/knowledge/decisions/internals/index.md +30 -3
- package/knowledge/decisions/internals/validate-runs-checks-by-precondition.md +115 -0
- package/knowledge/decisions/security/a-function-never-receives-the-secret-service.md +37 -0
- package/knowledge/decisions/security/a-workflow-run-is-read-and-approved-by-its-owner.md +30 -14
- package/knowledge/decisions/security/an-approval-answer-outlives-the-run-it-answered.md +59 -0
- package/knowledge/decisions/security/index.md +3 -1
- package/knowledge/questions/index.md +1 -1
- package/package.json +3 -2
- package/scripts/generate-api-report.mts +143 -18
- package/src/api-report.test.ts +2 -2
- package/src/errors/index.ts +1 -1
- package/src/function/function-runner.test.ts +52 -0
- package/src/function/function-runner.ts +5 -9
- package/src/function/index.ts +0 -2
- package/src/index.ts +0 -35
- package/src/pikku-state.ts +5 -0
- package/src/public-surface.json +81 -118
- package/src/services/ai-agent-runner-service.ts +12 -1
- package/src/services/ai-run-state-service.ts +11 -0
- package/src/services/in-memory-ai-run-state-service.ts +13 -0
- package/src/services/index.ts +7 -58
- package/src/services/meta-service.ts +2 -4
- package/src/services/scoped-credential-service.test.ts +86 -0
- package/src/services/scoped-credential-service.ts +63 -0
- package/src/testing/service-tests/ai-storage-service-tests.ts +93 -0
- package/src/types/core.types.ts +4 -7
- package/src/types/state.types.ts +21 -1
- package/src/wirings/actor-flow/index.ts +0 -3
- package/src/wirings/ai-agent/ai-agent-finalize.test.ts +186 -0
- package/src/wirings/ai-agent/ai-agent-finalize.ts +197 -0
- package/src/wirings/ai-agent/ai-agent-interrupt.ts +1 -0
- package/src/wirings/ai-agent/ai-agent-memory.ts +54 -38
- package/src/wirings/ai-agent/ai-agent-model-config.test.ts +72 -3
- package/src/wirings/ai-agent/ai-agent-model-config.ts +49 -1
- package/src/wirings/ai-agent/ai-agent-prepare.ts +4 -0
- package/src/wirings/ai-agent/ai-agent-runner.ts +71 -40
- package/src/wirings/ai-agent/ai-agent-stream-output-hooks.test.ts +353 -0
- package/src/wirings/ai-agent/ai-agent-stream.ts +116 -54
- package/src/wirings/ai-agent/ai-agent-turn.test.ts +67 -0
- package/src/wirings/ai-agent/ai-agent-turn.ts +1 -0
- package/src/wirings/ai-agent/ai-agent.types.ts +64 -4
- package/src/wirings/ai-agent/index.ts +2 -16
- package/src/wirings/ai-scorer/ai-scorer-grade.test.ts +106 -0
- package/src/wirings/ai-scorer/ai-scorer-grade.ts +55 -0
- package/src/wirings/ai-scorer/ai-scorer-judge.test.ts +143 -0
- package/src/wirings/ai-scorer/ai-scorer-judge.ts +120 -0
- package/src/wirings/ai-scorer/ai-scorer-live.test.ts +174 -0
- package/src/wirings/ai-scorer/ai-scorer-live.ts +56 -0
- package/src/wirings/ai-scorer/ai-scorer-registry.ts +63 -0
- package/src/wirings/ai-scorer/ai-scorer-sampling.test.ts +34 -0
- package/src/wirings/ai-scorer/ai-scorer-sampling.ts +36 -0
- package/src/wirings/ai-scorer/ai-scorer-snapshots.test.ts +49 -0
- package/src/wirings/ai-scorer/ai-scorer-snapshots.ts +46 -0
- package/src/wirings/ai-scorer/ai-scorer-worker.test.ts +122 -0
- package/src/wirings/ai-scorer/ai-scorer-worker.ts +69 -0
- package/src/wirings/ai-scorer/ai-scorer.ts +76 -0
- package/src/wirings/ai-scorer/ai-scorer.types.ts +107 -0
- package/src/wirings/ai-scorer/index.ts +24 -0
- package/src/wirings/channel/index.ts +1 -20
- package/src/wirings/channel/local/local-channel-runner.test.ts +68 -0
- package/src/wirings/channel/local/local-channel-runner.ts +8 -1
- package/src/wirings/cli/channel/cli-raw-channel-runner.test.ts +23 -0
- package/src/wirings/cli/channel/cli-raw-channel-runner.ts +12 -1
- package/src/wirings/cli/channel/index.ts +0 -7
- package/src/wirings/cli/cli-runner.test.ts +68 -0
- package/src/wirings/cli/cli-runner.ts +18 -1
- package/src/wirings/credential/index.ts +0 -1
- package/src/wirings/gateway/index.ts +0 -3
- package/src/wirings/http/http-runner.test.ts +66 -0
- package/src/wirings/http/http-runner.ts +10 -2
- package/src/wirings/http/index.ts +1 -1
- package/src/wirings/mcp/index.ts +0 -1
- package/src/wirings/mcp/mcp-runner.test.ts +181 -0
- package/src/wirings/mcp/mcp-runner.ts +35 -5
- package/src/wirings/persona/index.ts +0 -8
- package/src/wirings/queue/index.ts +0 -14
- package/src/wirings/rpc/addon-runner.ts +62 -3
- package/src/wirings/rpc/addon-secrets.test.ts +391 -0
- package/src/wirings/rpc/rpc-runner.test.ts +2 -0
- package/src/wirings/rpc/rpc-runner.ts +4 -0
- package/src/wirings/rpc/rpc-types.ts +8 -0
- package/src/wirings/rpc/wire-addon.ts +33 -0
- package/src/wirings/scheduler/index.ts +0 -1
- package/src/wirings/trigger/index.ts +0 -1
- package/src/wirings/virtual-user/index.ts +0 -16
- package/src/wirings/workflow/dsl/workflow-dsl.types.ts +96 -16
- package/src/wirings/workflow/feature.ts +2 -5
- package/src/wirings/workflow/graph/graph-runner.test.ts +72 -0
- package/src/wirings/workflow/index.ts +2 -68
- package/src/wirings/workflow/pikku-scenario-service.ts +81 -16
- package/src/wirings/workflow/pikku-workflow-service.test.ts +13 -12
- package/src/wirings/workflow/pikku-workflow-service.ts +28 -4
- package/src/wirings/workflow/scenario-expectations.test.ts +75 -0
- package/src/wirings/workflow/scenario-hooks.test.ts +3 -2
- package/src/wirings/workflow/scenario-step.types.ts +8 -0
- package/src/wirings/workflow/scenario.types.ts +63 -0
- package/src/wirings/workflow/workflow-approval-audit.ts +47 -0
- package/src/wirings/workflow/workflow-approval-policy.test.ts +524 -0
- package/src/wirings/workflow/workflow-approval-policy.ts +68 -0
- package/src/wirings/workflow/workflow-approval.ts +113 -9
- package/src/wirings/workflow/workflow-run-authority.test.ts +12 -15
- package/src/wirings/workflow/workflow-run-ownership.ts +2 -1
- package/src/wirings/workflow/workflow.types.ts +1 -63
- package/src/wirings-stay-decoupled.test.ts +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/internal.d.ts +0 -3
- package/dist/internal.js +0 -2
- package/dist/middleware/timeout.d.ts +0 -9
- package/dist/middleware/timeout.js +0 -15
- package/dist/pikku-response.d.ts +0 -6
- package/dist/pikku-response.js +0 -6
- package/dist/services/gopass-secrets.d.ts +0 -15
- package/dist/services/gopass-secrets.js +0 -76
- package/dist/services/http-scenario-actors.d.ts +0 -75
- package/dist/services/http-scenario-actors.js +0 -195
- package/dist/services/http-user-flow-actors.d.ts +0 -67
- package/dist/services/http-user-flow-actors.js +0 -193
- package/dist/services/scenario-actors-service.d.ts +0 -127
- package/dist/services/scenario-actors-service.js +0 -40
- package/dist/services/user-flow-actors-service.d.ts +0 -39
- package/dist/wirings/credential/wire-credential.d.ts +0 -48
- package/dist/wirings/credential/wire-credential.js +0 -47
- package/dist/wirings/oauth2/oauth2-client.d.ts +0 -47
- package/dist/wirings/oauth2/oauth2-client.js +0 -263
- package/dist/wirings/oauth2/oauth2-routes.d.ts +0 -35
- package/dist/wirings/oauth2/oauth2-routes.js +0 -146
- package/dist/wirings/scope/wire-scope.d.ts +0 -33
- package/dist/wirings/scope/wire-scope.js +0 -32
- package/dist/wirings/workflow/dsl/index.d.ts +0 -5
- package/dist/wirings/workflow/dsl/index.js +0 -4
- package/dist/wirings/workflow/graph/index.d.ts +0 -5
- package/dist/wirings/workflow/graph/index.js +0 -4
- /package/dist/{services/user-flow-actors-service.js → wirings/workflow/scenario.types.js} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export { wireChannel
|
|
2
|
-
export { addChannelMiddleware, combineChannelMiddleware,
|
|
1
|
+
export { wireChannel } from './channel-runner.js';
|
|
2
|
+
export { addChannelMiddleware, combineChannelMiddleware, } from './channel-middleware-runner.js';
|
|
3
3
|
export { logChannels } from './log-channels.js';
|
|
4
4
|
export { PikkuAbstractChannelHandler } from './pikku-abstract-channel-handler.js';
|
|
5
5
|
export { ChannelStore } from './channel-store.js';
|
|
6
6
|
export { EventHubStore } from './eventhub-store.js';
|
|
7
7
|
export { defineChannelRoutes } from './define-channel-routes.js';
|
|
8
|
-
export {
|
|
9
|
-
export { channelRemote, getChannelHostRPC, handleChannelRPCResponse, releaseChannelHostRPC, } from './channel-host-rpc.js';
|
|
8
|
+
export { ChannelDeploymentService, ChannelRPCError, ChannelRPCRegistry, unsupportedChannelRemote, } from './channel-rpc.js';
|
|
@@ -135,7 +135,14 @@ export const runLocalChannel = async ({ channelId, request, response, route, ski
|
|
|
135
135
|
channelHandler.registerOnMessage(async (data) => {
|
|
136
136
|
try {
|
|
137
137
|
const result = await onMessage(data);
|
|
138
|
-
|
|
138
|
+
// Guarded exactly as the connect path above is. A handler with nothing
|
|
139
|
+
// to say is normal — a gateway websocket's generated message handler
|
|
140
|
+
// always returns undefined — and sending that raised `send requires a
|
|
141
|
+
// non-empty message`, which surfaced as a channel that accepted a
|
|
142
|
+
// connection and then silently delivered nothing.
|
|
143
|
+
if (result !== undefined) {
|
|
144
|
+
await channel.send(result);
|
|
145
|
+
}
|
|
139
146
|
}
|
|
140
147
|
catch (e) {
|
|
141
148
|
singletonServices.logger.error(e);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { pikkuState } from '../../../pikku-state.js';
|
|
2
|
+
import { isProduction } from '../../../env.js';
|
|
2
3
|
import { parseCLIArguments, generateCommandHelp } from '../command-parser.js';
|
|
3
4
|
import { runCLICommand } from '../cli-runner.js';
|
|
4
5
|
/**
|
|
@@ -61,6 +62,13 @@ export async function handleRawCLI({ programName, args, singletonServices, creat
|
|
|
61
62
|
// A command can throw anything; `.message` off a string is undefined, and
|
|
62
63
|
// the run would then exit 1 saying nothing at all.
|
|
63
64
|
const message = e instanceof Error ? e.message : String(e);
|
|
64
|
-
|
|
65
|
+
// The raw message can carry internals (a stack, a DB error, a path). This
|
|
66
|
+
// runs over a channel that may be remote, so return a generic error in
|
|
67
|
+
// production and keep the detail server-side. Dev keeps the message inline.
|
|
68
|
+
singletonServices.logger.error?.(`CLI channel command failed: ${message}`, e);
|
|
69
|
+
const clientError = isProduction()
|
|
70
|
+
? 'Command failed'
|
|
71
|
+
: message || 'Command failed';
|
|
72
|
+
return { error: clientError, exitCode: 1, commandId };
|
|
65
73
|
}
|
|
66
74
|
}
|
|
@@ -2,6 +2,5 @@ export { executeCLIViaChannel } from './cli-channel-runner.js';
|
|
|
2
2
|
export { handleRawCLI } from './cli-raw-channel-runner.js';
|
|
3
3
|
export type { RawCLIFrame, RawCLIResult } from './cli-raw-channel-runner.js';
|
|
4
4
|
export { executeRawCLIViaChannel } from './cli-raw-client-runner.js';
|
|
5
|
-
export type {
|
|
6
|
-
export { APPROVAL_FLAGS, approverForMode, createTerminalApprover, takeApprovalFlags, } from './cli-approval.js';
|
|
5
|
+
export type { CorePikkuCLIClientRender, } from './cli-raw-client-runner.js';
|
|
7
6
|
export type { ApprovalMode } from './cli-approval.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { executeCLIViaChannel } from './cli-channel-runner.js';
|
|
2
2
|
export { handleRawCLI } from './cli-raw-channel-runner.js';
|
|
3
3
|
export { executeRawCLIViaChannel } from './cli-raw-client-runner.js';
|
|
4
|
-
export { APPROVAL_FLAGS, approverForMode, createTerminalApprover, takeApprovalFlags, } from './cli-approval.js';
|
|
@@ -87,7 +87,19 @@ function registerCLICommands(commands, path = [], inheritedOptions = {}, program
|
|
|
87
87
|
programs[program].commandMiddleware[commandId] = command.middleware;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
// Merge the command-level auth/permissions into the registered config so
|
|
91
|
+
// they are actually enforced by the function runner. They were accepted by
|
|
92
|
+
// the types but dropped here, making a command's declared access control a
|
|
93
|
+
// silent no-op. Command-level wins over the handler's own, then falls back
|
|
94
|
+
// to it.
|
|
95
|
+
const unwrapped = unwrapFunc(command);
|
|
96
|
+
const commandAuth = typeof command === 'object' ? command.auth : undefined;
|
|
97
|
+
const commandPermissions = typeof command === 'object' ? command.permissions : undefined;
|
|
98
|
+
addFunction(funcName, {
|
|
99
|
+
...unwrapped,
|
|
100
|
+
auth: commandAuth ?? unwrapped.auth,
|
|
101
|
+
permissions: commandPermissions ?? unwrapped.permissions,
|
|
102
|
+
}, currentMeta?.packageName);
|
|
91
103
|
if (typeof command === 'object' && command.render) {
|
|
92
104
|
if (programs[program]) {
|
|
93
105
|
programs[program].renderers[commandId] = command.render;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { defineCredential } from './define-credential.js';
|
|
2
2
|
export { validateAndBuildCredentialDefinitionsMeta } from './validate-credential-definitions.js';
|
|
3
|
-
export type { CoreCredential,
|
|
3
|
+
export type { CoreCredential, CredentialDefinitionsMeta, CredentialDefinitions, } from './credential.types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { wireGateway, createListenerMessageHandler, resolveGatewayAdapter, } from './gateway-runner.js';
|
|
2
|
-
export type { GatewayAdapter, GatewayAdapterFactory,
|
|
2
|
+
export type { GatewayAdapter, GatewayAdapterFactory, GatewayInboundMessage, GatewayOutboundMessage, GatewaysMeta, GatewayTransportType, CoreGateway, WebhookVerificationResult, } from './gateway.types.js';
|
|
@@ -173,6 +173,7 @@ const executeRoute = async (services, matchedRoute, http, options) => {
|
|
|
173
173
|
getSession: () => userSession.get(),
|
|
174
174
|
hasSessionChanged: () => userSession.sessionChanged,
|
|
175
175
|
};
|
|
176
|
+
const statusBeforeRoute = http?.response?.statusCode;
|
|
176
177
|
try {
|
|
177
178
|
result = await runPikkuFunc('http', `${meta.method}:${meta.route}`, meta.pikkuFuncId, {
|
|
178
179
|
singletonServices,
|
|
@@ -209,17 +210,22 @@ const executeRoute = async (services, matchedRoute, http, options) => {
|
|
|
209
210
|
http?.response?.flushHeaders?.();
|
|
210
211
|
}
|
|
211
212
|
else {
|
|
213
|
+
const statusSetByRoute = http?.response?.statusCode !== statusBeforeRoute;
|
|
212
214
|
if (result instanceof Response) {
|
|
213
215
|
await applyWebResponse(http.response, result);
|
|
214
216
|
}
|
|
215
217
|
else if (result === undefined || result === null) {
|
|
216
|
-
|
|
218
|
+
if (!statusSetByRoute) {
|
|
219
|
+
http?.response?.status(204);
|
|
220
|
+
}
|
|
217
221
|
}
|
|
218
222
|
else if (route.returnsJSON === false) {
|
|
219
223
|
http?.response?.arrayBuffer(result);
|
|
220
224
|
}
|
|
221
225
|
else {
|
|
222
|
-
|
|
226
|
+
if (!statusSetByRoute) {
|
|
227
|
+
http?.response?.status(200);
|
|
228
|
+
}
|
|
223
229
|
http?.response?.json(result);
|
|
224
230
|
}
|
|
225
231
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export { PikkuFetchHTTPRequest, DEFAULT_MAX_BODY_SIZE, } from './pikku-fetch-http-request.js';
|
|
2
|
-
export type { PikkuFetchHTTPRequestOptions } from './pikku-fetch-http-request.js';
|
|
3
2
|
export { PikkuFetchHTTPResponse } from './pikku-fetch-http-response.js';
|
|
4
3
|
export { logRoutes } from './log-http-routes.js';
|
|
5
4
|
export { fetch, fetchData, wireHTTP, addHTTPMiddleware } from './http-runner.js';
|
|
6
5
|
export { wireHTTPRoutes, defineHTTPRoutes } from './http-routes.js';
|
|
7
6
|
export { toWebRequest, applyWebResponse } from './web-request.js';
|
|
8
|
-
export type { AssertHTTPWiringParams, CoreHTTPFunctionWiring, HTTPMethod, HTTPRouteBaseConfig, HTTPRouteContract, HTTPRouteMap, HTTPWiringsMeta, PikkuHTTPRequest, PikkuHTTPResponse, PikkuQuery, RunHTTPWiringOptions, } from './http.types.js';
|
|
7
|
+
export type { AssertHTTPWiringParams, CoreHTTPFunctionWiring, HTTPMethod, HTTPRouteBaseConfig, HTTPRouteContract, HTTPRouteMap, HTTPWiringsMeta, PikkuHTTP, PikkuHTTPRequest, PikkuHTTPResponse, PikkuQuery, RunHTTPWiringOptions, } from './http.types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { MCPEndpointRegistry } from './mcp-endpoint-registry.js';
|
|
2
2
|
export { MCPError, wireMCPResource, wireMCPPrompt, runMCPResource, runMCPTool, runMCPPrompt, } from './mcp-runner.js';
|
|
3
3
|
export { getMCPResourcesMeta, getMCPToolsMeta, getMCPPromptsMeta, } from './mcp-runner.js';
|
|
4
|
-
export type { AssertMCPResourceURIParams, CoreMCPPrompt, CoreMCPResource,
|
|
4
|
+
export type { AssertMCPResourceURIParams, CoreMCPPrompt, CoreMCPResource, MCPPromptResponse, MCPResourceMeta, MCPResourceResponse, MCPToolMeta, MCPToolResponse, MCPPromptMeta, PikkuMCP, } from './mcp.types.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PikkuHTTP } from '../http/http.types.js';
|
|
1
2
|
import type { CoreMCPResource, CoreMCPPrompt, JsonRpcRequest, JsonRpcResponse, JsonRpcErrorResponse, PikkuMCP } from './mcp.types.js';
|
|
2
3
|
import type { CorePikkuFunctionConfig, CorePikkuFunctionSessionless } from '../../function/functions.types.js';
|
|
3
4
|
export declare class MCPError extends Error {
|
|
@@ -6,6 +7,20 @@ export declare class MCPError extends Error {
|
|
|
6
7
|
}
|
|
7
8
|
export type RunMCPEndpointParams<Tools extends string = any> = {
|
|
8
9
|
mcp?: PikkuMCP<Tools>;
|
|
10
|
+
/**
|
|
11
|
+
* The HTTP request the MCP call arrived on, when it arrived over HTTP.
|
|
12
|
+
*
|
|
13
|
+
* Auth middleware reads the session off `wire.http.request` — every
|
|
14
|
+
* implementation opens with `if (!http?.request) return` — so without this an
|
|
15
|
+
* MCP call reaches the function unauthenticated no matter what middleware the
|
|
16
|
+
* app has registered, and a tool fronting a session-requiring function can
|
|
17
|
+
* only ever answer 'Authentication required'.
|
|
18
|
+
*
|
|
19
|
+
* Left undefined for transports that have no request to offer, such as stdio.
|
|
20
|
+
* Those remain anonymous, which is a property of the transport rather than a
|
|
21
|
+
* default chosen here.
|
|
22
|
+
*/
|
|
23
|
+
http?: PikkuHTTP;
|
|
9
24
|
/** Defaults to enabled outside production. */
|
|
10
25
|
exposeErrors?: boolean;
|
|
11
26
|
};
|
|
@@ -48,6 +48,11 @@ export async function runMCPResource(request, params, uri) {
|
|
|
48
48
|
let extractedParams = {};
|
|
49
49
|
const metas = pikkuState(null, 'mcp', 'resourcesMeta');
|
|
50
50
|
const endpoints = pikkuState(null, 'mcp', 'resources');
|
|
51
|
+
// The key the resource's meta (and its middleware) is stored under. For a
|
|
52
|
+
// templated resource this is the template, not the concrete request URI — so
|
|
53
|
+
// it must be carried forward, or the meta lookup downstream misses and the
|
|
54
|
+
// resource's declared middleware (including auth) is silently skipped.
|
|
55
|
+
let metaKey = uri;
|
|
51
56
|
if (endpoints.has(uri)) {
|
|
52
57
|
endpoint = endpoints.get(uri);
|
|
53
58
|
pikkuFuncId = metas[uri]?.pikkuFuncId;
|
|
@@ -60,6 +65,7 @@ export async function runMCPResource(request, params, uri) {
|
|
|
60
65
|
const match = uri.match(regex);
|
|
61
66
|
if (match) {
|
|
62
67
|
endpoint = value;
|
|
68
|
+
metaKey = uriTemplate;
|
|
63
69
|
pikkuFuncId = metas[uriTemplate]?.pikkuFuncId;
|
|
64
70
|
for (let i = 0; i < paramNames.length; i++) {
|
|
65
71
|
extractedParams[paramNames[i]] = match[i + 1]; // match[0] is the full match
|
|
@@ -71,7 +77,7 @@ export async function runMCPResource(request, params, uri) {
|
|
|
71
77
|
return await runMCPPikkuFunc({
|
|
72
78
|
...request,
|
|
73
79
|
params: { ...request.params, ...extractedParams },
|
|
74
|
-
}, 'resource', uri, endpoint, pikkuFuncId, { ...params, mcp: { ...params.mcp, uri } });
|
|
80
|
+
}, 'resource', uri, endpoint, pikkuFuncId, { ...params, mcp: { ...params.mcp, uri } }, metaKey);
|
|
75
81
|
}
|
|
76
82
|
export async function runMCPTool(request, params, name) {
|
|
77
83
|
const meta = pikkuState(null, 'mcp', 'toolsMeta')[name];
|
|
@@ -82,7 +88,11 @@ export async function runMCPPrompt(request, params, name) {
|
|
|
82
88
|
const meta = pikkuState(null, 'mcp', 'promptsMeta')[name];
|
|
83
89
|
return await runMCPPikkuFunc(request, 'prompt', name, endpoint, meta?.pikkuFuncId, params);
|
|
84
90
|
}
|
|
85
|
-
async function runMCPPikkuFunc(request, type, name, mcp, pikkuFuncId, { mcp: mcpWire, exposeErrors = !isProduction() }
|
|
91
|
+
async function runMCPPikkuFunc(request, type, name, mcp, pikkuFuncId, { mcp: mcpWire, http, exposeErrors = !isProduction() },
|
|
92
|
+
// The key the endpoint's meta is stored under. Differs from `name` only for a
|
|
93
|
+
// templated resource, where `name` is the concrete URI and the meta lives
|
|
94
|
+
// under the template. Defaults to `name` for tools and prompts.
|
|
95
|
+
metaKey = name) {
|
|
86
96
|
const singletonServices = getSingletonServices();
|
|
87
97
|
const createWireServices = getCreateWireServices();
|
|
88
98
|
try {
|
|
@@ -99,17 +109,20 @@ async function runMCPPikkuFunc(request, type, name, mcp, pikkuFuncId, { mcp: mcp
|
|
|
99
109
|
const mcpSessionService = new PikkuSessionService(singletonServices.sessionStore);
|
|
100
110
|
const wire = {
|
|
101
111
|
mcp: mcpWire,
|
|
112
|
+
// Only when the transport supplied one. Setting `http: undefined`
|
|
113
|
+
// explicitly would be the same to a reader and different to a spread.
|
|
114
|
+
...(http ? { http } : {}),
|
|
102
115
|
...createMiddlewareSessionWireProps(mcpSessionService),
|
|
103
116
|
};
|
|
104
117
|
let meta;
|
|
105
118
|
if (type === 'resource') {
|
|
106
|
-
meta = pikkuState(null, 'mcp', 'resourcesMeta')[
|
|
119
|
+
meta = pikkuState(null, 'mcp', 'resourcesMeta')[metaKey];
|
|
107
120
|
}
|
|
108
121
|
else if (type === 'tool') {
|
|
109
|
-
meta = pikkuState(null, 'mcp', 'toolsMeta')[
|
|
122
|
+
meta = pikkuState(null, 'mcp', 'toolsMeta')[metaKey];
|
|
110
123
|
}
|
|
111
124
|
else if (type === 'prompt') {
|
|
112
|
-
meta = pikkuState(null, 'mcp', 'promptsMeta')[
|
|
125
|
+
meta = pikkuState(null, 'mcp', 'promptsMeta')[metaKey];
|
|
113
126
|
}
|
|
114
127
|
let resolvedFuncName = pikkuFuncId;
|
|
115
128
|
let resolvedPackageName = meta?.packageName ?? null;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export { definePersonas } from './define-personas.js';
|
|
2
2
|
export { isRunnablePersona, roleMismatchMessage, runnablePersonas, validateAndBuildPersonasMeta, verifyPersonaRoles, } from './validate-personas.js';
|
|
3
3
|
export type { RoleVerification } from './validate-personas.js';
|
|
4
|
-
export { personaEnvironmentErrors, personaEnvironmentRefusal,
|
|
4
|
+
export { personaEnvironmentErrors, personaEnvironmentRefusal, } from './persona-environments.js';
|
|
5
5
|
export type { PersonaEnvironment, PersonaEnvironmentSubject, } from './persona-environments.js';
|
|
6
|
-
export { personaEmail,
|
|
7
|
-
export { allowedLinks, applyMailboxAllowlist, isAllowedSender, } from './persona-mailbox.js';
|
|
6
|
+
export { personaEmail, personaEmails, } from './persona-email.js';
|
|
8
7
|
export type { MailboxAllowlist, PersonaMailbox, ReceivedEmail, } from './persona-mailbox.js';
|
|
9
|
-
export type { CorePersona,
|
|
8
|
+
export type { CorePersona, CorePersonas, PersonaAccountMeta, PersonaDefinitions, PersonaMeta, PersonasMeta, } from './persona.types.js';
|
|
10
9
|
/**
|
|
11
10
|
* Signing in as a persona and talking to a stage over HTTP.
|
|
12
11
|
*
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export { definePersonas } from './define-personas.js';
|
|
2
2
|
export { isRunnablePersona, roleMismatchMessage, runnablePersonas, validateAndBuildPersonasMeta, verifyPersonaRoles, } from './validate-personas.js';
|
|
3
|
-
export { personaEnvironmentErrors, personaEnvironmentRefusal,
|
|
4
|
-
export { personaEmail,
|
|
5
|
-
export { allowedLinks, applyMailboxAllowlist, isAllowedSender, } from './persona-mailbox.js';
|
|
3
|
+
export { personaEnvironmentErrors, personaEnvironmentRefusal, } from './persona-environments.js';
|
|
4
|
+
export { personaEmail, personaEmails, } from './persona-email.js';
|
|
6
5
|
/**
|
|
7
6
|
* Signing in as a persona and talking to a stage over HTTP.
|
|
8
7
|
*
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export type { ConfigValidationResult, CoreQueueWorker, GroupConcurrencyConfig, JobGroup, JobOptions, PikkuJobConfig, PikkuWorkerConfig, PikkuQueue, QueueJob, QueueJobStatus, QueueService, QueueWorkers, QueueWorkersMeta, } from './queue.types.js';
|
|
2
|
-
export { wireQueueWorker, runQueueJob,
|
|
3
|
-
export { QUEUE_IDENTITY_CLAIM_VERSION, QUEUE_IDENTITY_INFO, QUEUE_IDENTITY_SECRET_NAME, getQueueIdentitySecret, resolveQueueJobIdentity, signQueueIdentity, verifyQueueIdentity, } from './queue-identity.js';
|
|
2
|
+
export { wireQueueWorker, runQueueJob, QueueJobDiscardedError, QueueJobFailedError, } from './queue-runner.js';
|
|
4
3
|
export type { QueueIdentityBinding } from './queue-identity.js';
|
|
5
4
|
export { SignedQueueService } from './signed-queue-service.js';
|
|
6
|
-
export { validateWorkerConfig } from './validate-worker-config.js';
|
|
7
5
|
export type { QueueConfigMapping } from './validate-worker-config.js';
|
|
8
6
|
export { registerQueueWorkers } from './register-queue-helper.js';
|
|
9
7
|
export type { QueueRegistrationCallback } from './register-queue-helper.js';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { wireQueueWorker, runQueueJob,
|
|
2
|
-
export { QUEUE_IDENTITY_CLAIM_VERSION, QUEUE_IDENTITY_INFO, QUEUE_IDENTITY_SECRET_NAME, getQueueIdentitySecret, resolveQueueJobIdentity, signQueueIdentity, verifyQueueIdentity, } from './queue-identity.js';
|
|
1
|
+
export { wireQueueWorker, runQueueJob, QueueJobDiscardedError, QueueJobFailedError, } from './queue-runner.js';
|
|
3
2
|
export { SignedQueueService } from './signed-queue-service.js';
|
|
4
|
-
export { validateWorkerConfig } from './validate-worker-config.js';
|
|
5
3
|
export { registerQueueWorkers } from './register-queue-helper.js';
|
|
@@ -4,6 +4,14 @@ export type AddonInstance = {
|
|
|
4
4
|
secretOverrides?: Record<string, string>;
|
|
5
5
|
variableOverrides?: Record<string, string>;
|
|
6
6
|
credentialOverrides?: Record<string, string>;
|
|
7
|
+
/** Set by the consuming app: secrets it lends this instance, as the addon names them. */
|
|
8
|
+
secretGrants?: string[];
|
|
9
|
+
/** Set by the consuming app: credentials it lends this instance, as the addon names them. */
|
|
10
|
+
credentialGrants?: string[];
|
|
11
|
+
/** Set by the consuming app to opt this instance out of secret scoping. */
|
|
12
|
+
globalSecrets?: string;
|
|
13
|
+
/** Set by the consuming app to opt this instance out of credential scoping. */
|
|
14
|
+
globalCredentials?: string;
|
|
7
15
|
};
|
|
8
16
|
export declare const getOrCreatePackageSingletonServices: (packageName: string, parentServices: CoreSingletonServices, addonInstance?: AddonInstance) => Promise<CoreSingletonServices>;
|
|
9
17
|
export declare const addonInstanceForNamespace: (namespace: string | undefined, expectedPackage: string) => AddonInstance | undefined;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { pikkuState } from '../../pikku-state.js';
|
|
2
|
+
import { ScopedSecretService } from '../../services/scoped-secret-service.js';
|
|
3
|
+
import { ScopedCredentialService } from '../../services/scoped-credential-service.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the addon declared, plus what the host lent it. Scoping runs outside the
|
|
6
|
+
* aliaser, so every name here is the one the addon reads — which is why an
|
|
7
|
+
* override's *key* grants, and its value does not.
|
|
8
|
+
*/
|
|
9
|
+
const allowedNames = (declared, grants, overrides) => new Set([
|
|
10
|
+
...(declared ?? []),
|
|
11
|
+
...(grants ?? []),
|
|
12
|
+
...Object.keys(overrides ?? {}),
|
|
13
|
+
]);
|
|
2
14
|
const aliasSecretService = (secrets, overrides) => {
|
|
3
15
|
const map = (key) => overrides[key] ?? key;
|
|
4
16
|
return {
|
|
@@ -79,9 +91,6 @@ export const getOrCreatePackageSingletonServices = async (packageName, parentSer
|
|
|
79
91
|
return cachedServices;
|
|
80
92
|
}
|
|
81
93
|
const factories = pikkuState(packageName, 'package', 'factories');
|
|
82
|
-
if (!factories || !factories.createSingletonServices) {
|
|
83
|
-
return parentServices;
|
|
84
|
-
}
|
|
85
94
|
let existingServices = parentServices;
|
|
86
95
|
if (addonInstance?.secretOverrides && parentServices.secrets) {
|
|
87
96
|
existingServices = {
|
|
@@ -95,6 +104,21 @@ export const getOrCreatePackageSingletonServices = async (packageName, parentSer
|
|
|
95
104
|
variables: aliasVariablesService(parentServices.variables, addonInstance.variableOverrides),
|
|
96
105
|
};
|
|
97
106
|
}
|
|
107
|
+
if (!addonInstance?.globalSecrets && existingServices.secrets) {
|
|
108
|
+
existingServices = {
|
|
109
|
+
...existingServices,
|
|
110
|
+
secrets: new ScopedSecretService(existingServices.secrets, allowedNames(pikkuState(packageName, 'package', 'declaredSecrets'), addonInstance?.secretGrants, addonInstance?.secretOverrides)),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (!addonInstance?.globalCredentials && existingServices.credentialService) {
|
|
114
|
+
existingServices = {
|
|
115
|
+
...existingServices,
|
|
116
|
+
credentialService: new ScopedCredentialService(existingServices.credentialService, allowedNames(Object.keys(pikkuState(packageName, 'package', 'credentialsMeta') ?? {}), addonInstance?.credentialGrants, addonInstance?.credentialOverrides)),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (!factories || !factories.createSingletonServices) {
|
|
120
|
+
return existingServices;
|
|
121
|
+
}
|
|
98
122
|
let config = existingServices.config;
|
|
99
123
|
if (factories.createConfig) {
|
|
100
124
|
config = await factories.createConfig(existingServices.variables);
|
|
@@ -118,5 +142,9 @@ export const addonInstanceForNamespace = (namespace, expectedPackage) => {
|
|
|
118
142
|
secretOverrides: cfg.secretOverrides,
|
|
119
143
|
variableOverrides: cfg.variableOverrides,
|
|
120
144
|
credentialOverrides: cfg.credentialOverrides,
|
|
145
|
+
secretGrants: cfg.secretGrants,
|
|
146
|
+
credentialGrants: cfg.credentialGrants,
|
|
147
|
+
globalSecrets: cfg.globalSecrets,
|
|
148
|
+
globalCredentials: cfg.globalCredentials,
|
|
121
149
|
};
|
|
122
150
|
};
|
|
@@ -203,6 +203,10 @@ export class ContextAwareRPCService {
|
|
|
203
203
|
secretOverrides: resolved.addonConfig?.secretOverrides,
|
|
204
204
|
variableOverrides: resolved.addonConfig?.variableOverrides,
|
|
205
205
|
credentialOverrides: resolved.addonConfig?.credentialOverrides,
|
|
206
|
+
secretGrants: resolved.addonConfig?.secretGrants,
|
|
207
|
+
credentialGrants: resolved.addonConfig?.credentialGrants,
|
|
208
|
+
globalSecrets: resolved.addonConfig?.globalSecrets,
|
|
209
|
+
globalCredentials: resolved.addonConfig?.globalCredentials,
|
|
206
210
|
},
|
|
207
211
|
};
|
|
208
212
|
}
|
|
@@ -48,6 +48,14 @@ export interface ResolvedFunction {
|
|
|
48
48
|
secretOverrides?: Record<string, string>;
|
|
49
49
|
variableOverrides?: Record<string, string>;
|
|
50
50
|
credentialOverrides?: Record<string, string>;
|
|
51
|
+
/** Set by the consuming app: secrets it lends this instance, as the addon names them */
|
|
52
|
+
secretGrants?: string[];
|
|
53
|
+
/** Set by the consuming app: credentials it lends this instance, as the addon names them */
|
|
54
|
+
credentialGrants?: string[];
|
|
55
|
+
/** Set by the consuming app: hand this instance the unscoped `SecretService` */
|
|
56
|
+
globalSecrets?: string;
|
|
57
|
+
/** Set by the consuming app: hand this instance the unscoped `CredentialService` */
|
|
58
|
+
globalCredentials?: string;
|
|
51
59
|
/** Set by `wireRemoteAddon`: dispatch this namespace's RPCs over HTTP */
|
|
52
60
|
remote?: boolean;
|
|
53
61
|
serverUrl?: string | ((services: any) => string | Promise<string>);
|
|
@@ -11,6 +11,31 @@ export type WireAddonConfig = {
|
|
|
11
11
|
secretOverrides?: Record<string, string>;
|
|
12
12
|
variableOverrides?: Record<string, string>;
|
|
13
13
|
credentialOverrides?: Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Secrets this instance may read on top of the ones it declared, named as the
|
|
16
|
+
* addon reads them — the scope check runs before `secretOverrides` renames
|
|
17
|
+
* them, so an overridden secret is named here by its addon-side key. Listing
|
|
18
|
+
* one in `secretOverrides` grants it too.
|
|
19
|
+
*
|
|
20
|
+
* For an addon whose secret names come off its input rather than its own
|
|
21
|
+
* source, this is how the host lends names the addon could not declare.
|
|
22
|
+
*/
|
|
23
|
+
secretGrants?: string[];
|
|
24
|
+
/** Credentials this instance may read on top of the ones it declared. */
|
|
25
|
+
credentialGrants?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Hands this instance the whole `SecretService` instead of one scoped to the
|
|
28
|
+
* secrets it declared. The value is the reason, recorded in the deploy
|
|
29
|
+
* manifest — an addon that names secrets at runtime cannot be scoped, and
|
|
30
|
+
* only the consuming app, never the addon, can grant it.
|
|
31
|
+
*/
|
|
32
|
+
globalSecrets?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Hands this instance the whole `CredentialService` instead of one narrowed
|
|
35
|
+
* to the credentials it declared. The value is the reason, recorded in the
|
|
36
|
+
* deploy manifest, and only the consuming app can grant it.
|
|
37
|
+
*/
|
|
38
|
+
globalCredentials?: string;
|
|
14
39
|
};
|
|
15
40
|
export declare const wireAddon: (config: WireAddonConfig) => void;
|
|
16
41
|
/**
|
|
@@ -16,6 +16,14 @@ export const wireAddon = (config) => {
|
|
|
16
16
|
...(config.credentialOverrides
|
|
17
17
|
? { credentialOverrides: config.credentialOverrides }
|
|
18
18
|
: {}),
|
|
19
|
+
...(config.secretGrants ? { secretGrants: config.secretGrants } : {}),
|
|
20
|
+
...(config.credentialGrants
|
|
21
|
+
? { credentialGrants: config.credentialGrants }
|
|
22
|
+
: {}),
|
|
23
|
+
...(config.globalSecrets ? { globalSecrets: config.globalSecrets } : {}),
|
|
24
|
+
...(config.globalCredentials
|
|
25
|
+
? { globalCredentials: config.globalCredentials }
|
|
26
|
+
: {}),
|
|
19
27
|
});
|
|
20
28
|
};
|
|
21
29
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { runScheduledTask, wireScheduler, getScheduledTasks, } from './scheduler-runner.js';
|
|
2
2
|
export { logSchedulers } from './log-schedulers.js';
|
|
3
|
-
export type { CoreScheduledTask, ScheduledTasksMeta,
|
|
3
|
+
export type { CoreScheduledTask, ScheduledTasksMeta, } from './scheduler.types.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { wireTrigger, wireTriggerSource } from './trigger-runner.js';
|
|
2
2
|
export { PikkuTriggerService } from './pikku-trigger-service.js';
|
|
3
|
-
export type { TriggerMeta, TriggerSourceMeta, CorePikkuTriggerFunction, CorePikkuTriggerFunctionConfig, CoreTrigger,
|
|
3
|
+
export type { TriggerMeta, TriggerSourceMeta, CorePikkuTriggerFunction, CorePikkuTriggerFunctionConfig, CoreTrigger, } from './trigger.types.js';
|
|
@@ -16,15 +16,14 @@
|
|
|
16
16
|
* {@link VirtualUserTarget}, which in production is an `HttpPersona`
|
|
17
17
|
* signed in as a real user against staging or production.
|
|
18
18
|
*/
|
|
19
|
-
export type { ApiCatalogueEntry,
|
|
19
|
+
export type { ApiCatalogueEntry, IntentSource, VirtualUserDisposition, VirtualUserFinding, VirtualUserRunResult, VirtualUserTarget, } from './virtual-user.types.js';
|
|
20
20
|
export { PRODUCTION_DISPOSITION } from './virtual-user.types.js';
|
|
21
|
-
export { runVirtualUser,
|
|
21
|
+
export { runVirtualUser, type RunVirtualUserParams, } from './run-virtual-user.js';
|
|
22
22
|
export { personaScopes, prepareVirtualUserRun, type VirtualUserPreparation, } from './prepare-virtual-user-run.js';
|
|
23
23
|
export type { VirtualUserRunOutcome, VirtualUserRunRecord, VirtualUserRunStart, VirtualUserRunStore, } from './virtual-user-run-store.js';
|
|
24
24
|
export { DISPOSITIONS, dispositionProfile, type DispositionProfile, type VirtualUserTuning, } from './virtual-user-dispositions.js';
|
|
25
|
-
export { catalogueClassification,
|
|
26
|
-
export {
|
|
27
|
-
export { IntentStack, intentsForPersona,
|
|
28
|
-
export { createRng, type VirtualUserRng } from './virtual-user-rng.js';
|
|
25
|
+
export { catalogueClassification, catalogueLookup, isReadOnly, reachableCatalogue, unreachableCatalogue, } from './virtual-user-catalogue.js';
|
|
26
|
+
export { type AgentReachability, type ReachableAgent, } from './virtual-user-agents.js';
|
|
27
|
+
export { IntentStack, intentsForPersona, } from './virtual-user-intents.js';
|
|
29
28
|
export { deriveCatalogue, deriveIntents, type SchemaMap, } from './virtual-user-derive.js';
|
|
30
29
|
export { personaVirtualUserTarget, type PersonaTargetOptions, } from './virtual-user-target.js';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export { PRODUCTION_DISPOSITION } from './virtual-user.types.js';
|
|
2
|
-
export { runVirtualUser,
|
|
2
|
+
export { runVirtualUser, } from './run-virtual-user.js';
|
|
3
3
|
export { personaScopes, prepareVirtualUserRun, } from './prepare-virtual-user-run.js';
|
|
4
4
|
export { DISPOSITIONS, dispositionProfile, } from './virtual-user-dispositions.js';
|
|
5
|
-
export { catalogueClassification,
|
|
6
|
-
export { reachableAgents, } from './virtual-user-agents.js';
|
|
5
|
+
export { catalogueClassification, catalogueLookup, isReadOnly, reachableCatalogue, unreachableCatalogue, } from './virtual-user-catalogue.js';
|
|
7
6
|
export { IntentStack, intentsForPersona, } from './virtual-user-intents.js';
|
|
8
|
-
export { createRng } from './virtual-user-rng.js';
|
|
9
7
|
export { deriveCatalogue, deriveIntents, } from './virtual-user-derive.js';
|
|
10
8
|
export { personaVirtualUserTarget, } from './virtual-user-target.js';
|