@pikku/cli 0.12.15 → 0.12.16
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/cli.schema.json +1 -1
- package/console-app/assets/index-CzMWJFqj.js +700 -0
- package/console-app/index.html +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +16 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +68 -5
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +16 -19
- package/dist/.pikku/function/pikku-function-types.gen.js +15 -19
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +190 -107
- package/dist/.pikku/function/pikku-functions.gen.js +6 -2
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +18 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +2 -2
- package/dist/.pikku/http/pikku-http-wirings.gen.js +3 -3
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +3 -10
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -18
- package/dist/.pikku/pikku-meta-service.gen.d.ts +7 -0
- package/dist/.pikku/pikku-meta-service.gen.js +9 -0
- package/dist/.pikku/pikku-services.gen.d.ts +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +5 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +15 -7
- package/dist/.pikku/schemas/schemas/DeployApplyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DeployPlanInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuNewAddonInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuWorkflowRoutesOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/RemoteRPCHandlerInput.schema.json +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +3 -24
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -14
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/src/cli.wiring.js +63 -4
- package/dist/src/deploy/analyzer/analyzer.d.ts +16 -0
- package/dist/src/deploy/analyzer/analyzer.js +557 -0
- package/dist/src/deploy/analyzer/index.d.ts +3 -0
- package/dist/src/deploy/analyzer/index.js +1 -0
- package/dist/src/deploy/analyzer/manifest.d.ts +112 -0
- package/dist/src/deploy/analyzer/manifest.js +8 -0
- package/dist/src/deploy/build-pipeline.d.ts +39 -0
- package/dist/src/deploy/build-pipeline.js +209 -0
- package/dist/src/deploy/bundler/bundler.d.ts +30 -0
- package/dist/src/deploy/bundler/bundler.js +196 -0
- package/dist/src/deploy/bundler/dep-extractor.d.ts +35 -0
- package/dist/src/deploy/bundler/dep-extractor.js +213 -0
- package/dist/src/deploy/bundler/index.d.ts +3 -0
- package/dist/src/deploy/bundler/index.js +2 -0
- package/dist/src/deploy/bundler/types.d.ts +21 -0
- package/dist/src/deploy/bundler/types.js +5 -0
- package/dist/src/deploy/codegen/index.d.ts +2 -0
- package/dist/src/deploy/codegen/index.js +1 -0
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +44 -0
- package/dist/src/deploy/codegen/per-unit-codegen.js +216 -0
- package/dist/src/deploy/plan/executor.d.ts +9 -0
- package/dist/src/deploy/plan/executor.js +49 -0
- package/dist/src/deploy/plan/formatter.d.ts +4 -0
- package/dist/src/deploy/plan/formatter.js +114 -0
- package/dist/src/deploy/plan/index.d.ts +5 -0
- package/dist/src/deploy/plan/index.js +3 -0
- package/dist/src/deploy/plan/planner.d.ts +4 -0
- package/dist/src/deploy/plan/planner.js +220 -0
- package/dist/src/deploy/plan/provider.d.ts +30 -0
- package/dist/src/deploy/plan/provider.js +1 -0
- package/dist/src/deploy/plan/types.d.ts +29 -0
- package/dist/src/deploy/plan/types.js +1 -0
- package/dist/src/deploy/provider-adapter.d.ts +111 -0
- package/dist/src/deploy/provider-adapter.js +10 -0
- package/dist/src/functions/commands/all.js +6 -2
- package/dist/src/functions/commands/deploy-apply.d.ts +22 -0
- package/dist/src/functions/commands/deploy-apply.js +206 -0
- package/dist/src/functions/commands/deploy-info.d.ts +1 -0
- package/dist/src/functions/commands/deploy-info.js +122 -0
- package/dist/src/functions/commands/deploy-plan.d.ts +10 -0
- package/dist/src/functions/commands/deploy-plan.js +96 -0
- package/dist/src/functions/commands/enable.js +1 -1
- package/dist/src/functions/commands/new-addon.d.ts +3 -0
- package/dist/src/functions/commands/new-addon.js +68 -2
- package/dist/src/functions/commands/pikku-command-bootstrap.js +30 -20
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +7 -3
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +7 -5
- package/dist/src/functions/wirings/channels/pikku-channels.js +3 -0
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +3 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +3 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +2 -2
- package/dist/src/functions/wirings/console/serialize-console-functions.js +2 -2
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +9 -2
- package/dist/src/functions/wirings/functions/serialize-function-imports.js +5 -3
- package/dist/src/functions/wirings/functions/serialize-function-types.js +17 -19
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +3 -0
- package/dist/src/functions/wirings/http/pikku-http-routes.js +3 -0
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +6 -0
- package/dist/src/functions/wirings/package/pikku-command-package.js +1 -1
- package/dist/src/functions/wirings/package/serialize-package.d.ts +1 -1
- package/dist/src/functions/wirings/package/serialize-package.js +5 -2
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +4 -0
- package/dist/src/functions/wirings/queue/pikku-queue.js +4 -0
- package/dist/src/functions/wirings/queue/serialize-queue-map.js +4 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +10 -3
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +5 -27
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +11 -14
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +28 -3
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +15 -5
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +4 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +21 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +10 -9
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +6 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +42 -5
- package/dist/src/functions/wirings/workflow/serialize-workflow-registration.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/serialize-workflow-registration.js +3 -2
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +139 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +4 -51
- package/dist/src/scaffold/rpc-remote.gen.d.ts +10 -0
- package/dist/src/scaffold/rpc-remote.gen.js +22 -0
- package/dist/src/services.js +12 -7
- package/dist/src/utils/pikku-cli-config.d.ts +1 -1
- package/dist/src/utils/pikku-cli-config.js +30 -28
- package/dist/src/utils/strip-verbose-meta.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -4
- package/console-app/assets/index-robZPL3O.js +0 -672
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +0 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +0 -47
package/console-app/index.html
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
} catch (e) {}
|
|
26
26
|
</script>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-CzMWJFqj.js"></script>
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/index-DvrDbftC.css">
|
|
29
29
|
</head>
|
|
30
30
|
<body>
|
|
@@ -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.16
|
|
3
3
|
*/
|
|
4
4
|
import { CoreAIAgent, PikkuAIMiddlewareHooks } from '@pikku/core/ai-agent';
|
|
5
5
|
import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
|
|
@@ -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.16
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* WebSocket channel backend for 'pikku' CLI commands
|
|
@@ -32,6 +32,9 @@ import { pikkuNewAddon } from '../../src/functions/commands/new-addon.js';
|
|
|
32
32
|
import { pikkuVersionsInit } from '../../src/functions/commands/versions-init.js';
|
|
33
33
|
import { pikkuVersionsCheck } from '../../src/functions/commands/versions-check.js';
|
|
34
34
|
import { pikkuVersionsUpdate } from '../../src/functions/commands/versions-update.js';
|
|
35
|
+
import { deployPlan } from '../../src/functions/commands/deploy-plan.js';
|
|
36
|
+
import { deployApply } from '../../src/functions/commands/deploy-apply.js';
|
|
37
|
+
import { deployInfo } from '../../src/functions/commands/deploy-info.js';
|
|
35
38
|
import { pikkuInfoFunctions } from '../../src/functions/commands/info.js';
|
|
36
39
|
import { pikkuInfoTags } from '../../src/functions/commands/info.js';
|
|
37
40
|
import { pikkuInfoMiddleware } from '../../src/functions/commands/info.js';
|
|
@@ -184,6 +187,18 @@ wireChannel({
|
|
|
184
187
|
func: pikkuVersionsUpdate,
|
|
185
188
|
middleware: [cliCloseOnComplete],
|
|
186
189
|
},
|
|
190
|
+
'deploy.plan': {
|
|
191
|
+
func: deployPlan,
|
|
192
|
+
middleware: [cliCloseOnComplete],
|
|
193
|
+
},
|
|
194
|
+
'deploy.apply': {
|
|
195
|
+
func: deployApply,
|
|
196
|
+
middleware: [cliCloseOnComplete],
|
|
197
|
+
},
|
|
198
|
+
'deploy.info': {
|
|
199
|
+
func: deployInfo,
|
|
200
|
+
middleware: [cliCloseOnComplete],
|
|
201
|
+
},
|
|
187
202
|
'info': {
|
|
188
203
|
func: pikkuInfoFunctions,
|
|
189
204
|
middleware: [cliCloseOnComplete],
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"pikkuFuncId": "enableRpc",
|
|
123
123
|
"positionals": [],
|
|
124
124
|
"options": {
|
|
125
|
-
"
|
|
125
|
+
"noAuth": {
|
|
126
126
|
"description": "Disable auth requirement",
|
|
127
127
|
"default": false
|
|
128
128
|
}
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"pikkuFuncId": "enableConsole",
|
|
134
134
|
"positionals": [],
|
|
135
135
|
"options": {
|
|
136
|
-
"
|
|
136
|
+
"noAuth": {
|
|
137
137
|
"description": "Disable auth requirement",
|
|
138
138
|
"default": false
|
|
139
139
|
}
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"pikkuFuncId": "enableAgent",
|
|
145
145
|
"positionals": [],
|
|
146
146
|
"options": {
|
|
147
|
-
"
|
|
147
|
+
"noAuth": {
|
|
148
148
|
"description": "Disable auth requirement",
|
|
149
149
|
"default": false
|
|
150
150
|
}
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"pikkuFuncId": "enableWorkflow",
|
|
156
156
|
"positionals": [],
|
|
157
157
|
"options": {
|
|
158
|
-
"
|
|
158
|
+
"noAuth": {
|
|
159
159
|
"description": "Disable auth requirement",
|
|
160
160
|
"default": false
|
|
161
161
|
}
|
|
@@ -290,6 +290,10 @@
|
|
|
290
290
|
"mcp": {
|
|
291
291
|
"description": "Add mcp: true to generated functions (expose as MCP tools)",
|
|
292
292
|
"default": false
|
|
293
|
+
},
|
|
294
|
+
"camelCase": {
|
|
295
|
+
"description": "Convert snake_case property names to camelCase in generated Zod schemas",
|
|
296
|
+
"default": false
|
|
293
297
|
}
|
|
294
298
|
},
|
|
295
299
|
"description": "Scaffold a new addon package",
|
|
@@ -327,6 +331,60 @@
|
|
|
327
331
|
}
|
|
328
332
|
}
|
|
329
333
|
},
|
|
334
|
+
"deploy": {
|
|
335
|
+
"pikkuFuncId": "",
|
|
336
|
+
"positionals": [],
|
|
337
|
+
"options": {},
|
|
338
|
+
"description": "Deploy Pikku project to cloud infrastructure",
|
|
339
|
+
"subcommands": {
|
|
340
|
+
"plan": {
|
|
341
|
+
"pikkuFuncId": "deployPlan",
|
|
342
|
+
"positionals": [],
|
|
343
|
+
"options": {
|
|
344
|
+
"provider": {
|
|
345
|
+
"description": "Deployment provider (cloudflare, aws)",
|
|
346
|
+
"default": "cloudflare",
|
|
347
|
+
"short": "p"
|
|
348
|
+
},
|
|
349
|
+
"resultFile": {
|
|
350
|
+
"description": "Write structured JSON plan result to this file path"
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"description": "Show deployment plan (what will be created, updated, deleted)"
|
|
354
|
+
},
|
|
355
|
+
"apply": {
|
|
356
|
+
"pikkuFuncId": "deployApply",
|
|
357
|
+
"positionals": [],
|
|
358
|
+
"options": {
|
|
359
|
+
"provider": {
|
|
360
|
+
"description": "Deployment provider (cloudflare, aws)",
|
|
361
|
+
"default": "cloudflare",
|
|
362
|
+
"short": "p"
|
|
363
|
+
},
|
|
364
|
+
"fromPlan": {
|
|
365
|
+
"description": "Skip build pipeline, deploy from existing plan output",
|
|
366
|
+
"default": false
|
|
367
|
+
},
|
|
368
|
+
"resultFile": {
|
|
369
|
+
"description": "Write structured JSON deploy result to this file path"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"description": "Execute the deployment plan"
|
|
373
|
+
},
|
|
374
|
+
"info": {
|
|
375
|
+
"pikkuFuncId": "deployInfo",
|
|
376
|
+
"positionals": [],
|
|
377
|
+
"options": {
|
|
378
|
+
"provider": {
|
|
379
|
+
"description": "Deployment provider (cloudflare, aws)",
|
|
380
|
+
"default": "cloudflare",
|
|
381
|
+
"short": "p"
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"description": "Show project deployment info (workers, queues, crons, secrets)"
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
330
388
|
"info": {
|
|
331
389
|
"pikkuFuncId": "pikkuInfoFunctions",
|
|
332
390
|
"positionals": [],
|
|
@@ -436,6 +494,10 @@
|
|
|
436
494
|
},
|
|
437
495
|
"stateInput": {
|
|
438
496
|
"description": "Load inspector state from JSON file (skips inspection)"
|
|
497
|
+
},
|
|
498
|
+
"outDir": {
|
|
499
|
+
"description": "Override output directory (default: from pikku.config.json)",
|
|
500
|
+
"short": "o"
|
|
439
501
|
}
|
|
440
502
|
}
|
|
441
503
|
}
|
|
@@ -464,7 +526,8 @@
|
|
|
464
526
|
"aiRunState",
|
|
465
527
|
"agentRunService",
|
|
466
528
|
"workflowRunService",
|
|
467
|
-
"credentialService"
|
|
529
|
+
"credentialService",
|
|
530
|
+
"metaService"
|
|
468
531
|
]
|
|
469
532
|
},
|
|
470
533
|
"filePath": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.16
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import type { CorePikkuMiddleware, CorePermissionGroup, PikkuWire, PickRequired } from '@pikku/core';
|
|
8
|
+
import type { CorePikkuFunctionConfig, CorePikkuAuth, CorePikkuAuthConfig, CorePikkuPermission } from '@pikku/core/function';
|
|
8
9
|
import { CreateWireServices } from '@pikku/core/internal';
|
|
9
10
|
import { PikkuError } from '@pikku/core/errors';
|
|
10
11
|
import type { NodeType } from '@pikku/core/node';
|
|
@@ -377,27 +378,23 @@ export declare function pikkuSessionlessFunc<In, Out = unknown>(func: PikkuFunct
|
|
|
377
378
|
*/
|
|
378
379
|
export declare const pikkuVoidFunc: (func: PikkuFunctionSessionless<void, void, "session" | "rpc"> | PikkuFunctionConfig<void, void, "session" | "rpc">) => PikkuFunctionConfig<void, void, "session" | "rpc", PikkuFunctionSessionless<void, void, "session" | "rpc", Services> | PikkuFunction<void, void, "session" | "rpc", Services>, undefined, undefined>;
|
|
379
380
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* without type compatibility issues.
|
|
381
|
+
* References a registered function by name for use in any wiring.
|
|
382
|
+
* Works for both local and addon functions — resolves via RPC at runtime.
|
|
383
383
|
*
|
|
384
|
-
* @template Name - The
|
|
385
|
-
* @param rpcName - The name of the
|
|
386
|
-
* @returns A Pikku function that proxies calls
|
|
384
|
+
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
|
385
|
+
* @param rpcName - The name of the function to reference
|
|
386
|
+
* @returns A Pikku function config that proxies calls via RPC
|
|
387
387
|
*
|
|
388
388
|
* @example
|
|
389
389
|
* ```typescript
|
|
390
|
-
* //
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
* func: addon('ext:hello'),
|
|
396
|
-
* tags: ['addon'],
|
|
397
|
-
* })
|
|
390
|
+
* // Use in agent tools
|
|
391
|
+
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
|
392
|
+
*
|
|
393
|
+
* // Use in HTTP wiring
|
|
394
|
+
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
|
398
395
|
* ```
|
|
399
396
|
*/
|
|
400
|
-
export declare const
|
|
397
|
+
export declare const ref: <Name extends keyof FlattenedRPCMap>(rpcName: Name) => PikkuFunctionConfig<FlattenedRPCMap[Name]["input"], FlattenedRPCMap[Name]["output"], "session" | "rpc">;
|
|
401
398
|
/**
|
|
402
399
|
* Creates a Pikku config factory.
|
|
403
400
|
* Use this to define your application's configuration factory.
|
|
@@ -501,5 +498,5 @@ export declare const addMiddleware: (tag: string, middleware: PikkuMiddleware[])
|
|
|
501
498
|
* ```
|
|
502
499
|
*/
|
|
503
500
|
export declare const addPermission: <In = unknown>(tag: string, permissions: CorePermissionGroup<PikkuPermission<In>> | PikkuPermission<In>[]) => void;
|
|
504
|
-
export { wireAddon } from '@pikku/core';
|
|
505
|
-
export type { WireAddonConfig } from '@pikku/core';
|
|
501
|
+
export { wireAddon } from '@pikku/core/rpc';
|
|
502
|
+
export type { WireAddonConfig } from '@pikku/core/rpc';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.16
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Core function, middleware, and permission types for all wirings
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { pikkuAuth as pikkuAuthCore } from '@pikku/core/function';
|
|
8
|
+
import { addMiddleware as addMiddlewareCore, addPermission as addPermissionCore } from '@pikku/core/middleware';
|
|
8
9
|
import { pikkuState as __pikkuState } from '@pikku/core/internal';
|
|
9
|
-
import { pikkuAuth as pikkuAuthCore } from '@pikku/core';
|
|
10
10
|
/**
|
|
11
11
|
* Factory function for creating permissions with tree-shaking support.
|
|
12
12
|
* Supports both direct function and configuration object syntax.
|
|
@@ -166,27 +166,23 @@ export const pikkuVoidFunc = (func) => {
|
|
|
166
166
|
return typeof func === 'function' ? { func } : func;
|
|
167
167
|
};
|
|
168
168
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* without type compatibility issues.
|
|
169
|
+
* References a registered function by name for use in any wiring.
|
|
170
|
+
* Works for both local and addon functions — resolves via RPC at runtime.
|
|
172
171
|
*
|
|
173
|
-
* @template Name - The
|
|
174
|
-
* @param rpcName - The name of the
|
|
175
|
-
* @returns A Pikku function that proxies calls
|
|
172
|
+
* @template Name - The function name (must be a key in FlattenedRPCMap)
|
|
173
|
+
* @param rpcName - The name of the function to reference
|
|
174
|
+
* @returns A Pikku function config that proxies calls via RPC
|
|
176
175
|
*
|
|
177
176
|
* @example
|
|
178
177
|
* ```typescript
|
|
179
|
-
* //
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* func: addon('ext:hello'),
|
|
185
|
-
* tags: ['addon'],
|
|
186
|
-
* })
|
|
178
|
+
* // Use in agent tools
|
|
179
|
+
* tools: [ref('todos:listTodos'), ref('myLocalFunc')]
|
|
180
|
+
*
|
|
181
|
+
* // Use in HTTP wiring
|
|
182
|
+
* wireHTTP({ route: '/greet', method: 'post', func: ref('greet') })
|
|
187
183
|
* ```
|
|
188
184
|
*/
|
|
189
|
-
export const
|
|
185
|
+
export const ref = (rpcName) => {
|
|
190
186
|
return {
|
|
191
187
|
func: async (_services, data, { rpc }) => {
|
|
192
188
|
return rpc.invoke(rpcName, data);
|
|
@@ -310,4 +306,4 @@ export const addMiddleware = (tag, middleware) => {
|
|
|
310
306
|
export const addPermission = (tag, permissions) => {
|
|
311
307
|
addPermissionCore(tag, permissions, null);
|
|
312
308
|
};
|
|
313
|
-
export { wireAddon } from '@pikku/core';
|
|
309
|
+
export { wireAddon } from '@pikku/core/rpc';
|