@pikku/cli 0.12.110 → 0.12.112
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 +271 -0
- package/console-app/assets/{abnfDiagram-N423BO3Z-Bz2Ycfpe.js → abnfDiagram-N423BO3Z-Bltf5dmS.js} +1 -1
- package/console-app/assets/architecture-TIHT7OUA-DgRqRaqo.js +1 -0
- package/console-app/assets/{architectureDiagram-T3A2C74G-CvAkxhy0.js → architectureDiagram-T3A2C74G-BTtx6R7-.js} +1 -1
- package/console-app/assets/{blockDiagram-VBNYF7ZC-CuVOo2PB.js → blockDiagram-VBNYF7ZC-DgeTIOaM.js} +1 -1
- package/console-app/assets/{c4Diagram-5PPSVZJV-4Vg8SxCa.js → c4Diagram-5PPSVZJV-CaswnNob.js} +1 -1
- package/console-app/assets/channel-37lNznWk.js +1 -0
- package/console-app/assets/{chunk-2GRJ4B5K-CKKR4_dC.js → chunk-2GRJ4B5K-OnpnkpQT.js} +1 -1
- package/console-app/assets/{chunk-4I5QYGJK-C-m_kVjm.js → chunk-4I5QYGJK-CWmfNXFr.js} +1 -1
- package/console-app/assets/{chunk-5RXB4S5H-CyUGtd0h.js → chunk-5RXB4S5H-M8QmKeuk.js} +1 -1
- package/console-app/assets/{chunk-6Q2QTUOP-BuzItInf.js → chunk-6Q2QTUOP-C_h5lS68.js} +1 -1
- package/console-app/assets/{chunk-7Z6QIM7H-BGiBPuWt.js → chunk-7Z6QIM7H-DSnVb09k.js} +1 -1
- package/console-app/assets/{chunk-GF5L2VYU-D8jaliB9.js → chunk-GF5L2VYU-BkX038sq.js} +1 -1
- package/console-app/assets/{chunk-I66GZJ75-C-Lq_UXl.js → chunk-I66GZJ75-b3yMIljX.js} +1 -1
- package/console-app/assets/{chunk-JQJVKLGR-D7viK-tf.js → chunk-JQJVKLGR-Bihcz4nv.js} +1 -1
- package/console-app/assets/{chunk-KBJHAD2P-BS9N9gG4.js → chunk-KBJHAD2P-CS7eflbk.js} +1 -1
- package/console-app/assets/{chunk-NSK5VX7P-Fi_H0vaS.js → chunk-NSK5VX7P-CfigFGDQ.js} +1 -1
- package/console-app/assets/{chunk-QR6OTTB3-BJdg-tcL.js → chunk-QR6OTTB3-BBy8NfTW.js} +1 -1
- package/console-app/assets/{chunk-RYQCIY6F-CVbGA6YZ.js → chunk-RYQCIY6F-BCfZVQef.js} +1 -1
- package/console-app/assets/{chunk-UBXNYLIW-BF-sAqEK.js → chunk-UBXNYLIW-DkMKDHW4.js} +1 -1
- package/console-app/assets/{chunk-W5SLKNZC-CXrJJ0BX.js → chunk-W5SLKNZC-BSLytTSJ.js} +1 -1
- package/console-app/assets/{chunk-WRU74C26-CGzysGBy.js → chunk-WRU74C26-Dic7ZP8H.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-B1prMCvW.js +1 -0
- package/console-app/assets/classDiagram-JCYQIIEL-BDCX9ZLm.js +1 -0
- package/console-app/assets/classDiagram-v2-OCEON4UE-BDCX9ZLm.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-BvFZIDHb.js → cose-bilkent-JH36ORCC-CEpWcE3M.js} +1 -1
- package/console-app/assets/{cynefin-VYW2F7L2-DRQ8xGmN.js → cynefin-VYW2F7L2-irPiPhgz.js} +1 -1
- package/console-app/assets/{cynefinDiagram-MW4NZA55-BwxQ4C1z.js → cynefinDiagram-MW4NZA55-CIkqQ912.js} +1 -1
- package/console-app/assets/{dagre-J22zmNeE.js → dagre-FZyyw3H3.js} +1 -1
- package/console-app/assets/{dagre-VZM6K2ZE-DPtUyvjD.js → dagre-VZM6K2ZE-Dxnnu7Rh.js} +1 -1
- package/console-app/assets/{diagram-7IWD3JNH-DGAzJ2Ln.js → diagram-7IWD3JNH-DaT47sVs.js} +1 -1
- package/console-app/assets/{diagram-B4RE2ZJO-D14cIfto.js → diagram-B4RE2ZJO-Dmht03tx.js} +1 -1
- package/console-app/assets/{diagram-LBJQPF4R-CUscJ_pO.js → diagram-LBJQPF4R-B--jwILh.js} +1 -1
- package/console-app/assets/{diagram-Q27KOJAE-CehBHMt3.js → diagram-Q27KOJAE-D9H0euUr.js} +1 -1
- package/console-app/assets/{diagram-UB23O5K3-BvazI_qH.js → diagram-UB23O5K3-DloUQ8tO.js} +1 -1
- package/console-app/assets/{ebnfDiagram-BXEA7PRR-CBZPYFwZ.js → ebnfDiagram-BXEA7PRR-gaOXzNBU.js} +1 -1
- package/console-app/assets/{erDiagram-JOGREHBK-BN3FevvT.js → erDiagram-JOGREHBK-3X9eTLsh.js} +1 -1
- package/console-app/assets/eventmodeling-45OFAUF4-BarrKD55.js +1 -0
- package/console-app/assets/flowDiagram-UKHOOZJN-B6RiRjcD.js +1 -0
- package/console-app/assets/{ganttDiagram-PKOTCBZU-03mWH2kB.js → ganttDiagram-PKOTCBZU-khAFwSBy.js} +1 -1
- package/console-app/assets/{gitGraph-TEB2WS4Q-By2486wn.js → gitGraph-TEB2WS4Q-Bb7uENmk.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-DS77QQ5N-CCzKPRBJ.js → gitGraphDiagram-DS77QQ5N-OkSBM0h0.js} +1 -1
- package/console-app/assets/{index-snBzz_U8.js → index-Bn1BoT3w.js} +184 -184
- package/console-app/assets/{info-DKCQHKI2-C_vsavqC.js → info-DKCQHKI2-BH5dbX2B.js} +1 -1
- package/console-app/assets/{infoDiagram-6WML65LV-BKvU8du7.js → infoDiagram-6WML65LV-IbUl8J2C.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-WSZJBQD7-CnF0qm0n.js → ishikawaDiagram-WSZJBQD7-CX0gA3de.js} +1 -1
- package/console-app/assets/{journeyDiagram-NVQOT4AX-DxKe9OZ7.js → journeyDiagram-NVQOT4AX--k2etXu8.js} +1 -1
- package/console-app/assets/{kanban-definition-27J2QSJJ-CB8lgPxU.js → kanban-definition-27J2QSJJ-D1FvtPpN.js} +1 -1
- package/console-app/assets/{line-DFNLso1I.js → line-JLMY_DDK.js} +1 -1
- package/console-app/assets/{linear-D1cspVtk.js → linear-CSvLB3cd.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-BtmN233C.js → mermaid-parser.core-CwwjcAjz.js} +3 -3
- package/console-app/assets/{mermaid.core-37H5_HoB.js → mermaid.core-hmS_M4K5.js} +4 -4
- package/console-app/assets/{mindmap-definition-FAOFIHXS-Czf82JOB.js → mindmap-definition-FAOFIHXS-rTDa_CTp.js} +1 -1
- package/console-app/assets/{packet-7NZHBO7P-CErYxAQM.js → packet-7NZHBO7P-DBUJcYfI.js} +1 -1
- package/console-app/assets/{pegDiagram-VL7TDLO6-CRKX6HOt.js → pegDiagram-VL7TDLO6-D42PxXnS.js} +1 -1
- package/console-app/assets/{pie-RZYD4A2V-YmMmh6Nq.js → pie-RZYD4A2V-dM0uFAE4.js} +1 -1
- package/console-app/assets/{pieDiagram-7S7Q4E2Y-Cot0Fu5q.js → pieDiagram-7S7Q4E2Y-wCln1ucl.js} +1 -1
- package/console-app/assets/{quadrantDiagram-CIZ2JOQS-DPEonVYT.js → quadrantDiagram-CIZ2JOQS-DrRwS1g5.js} +1 -1
- package/console-app/assets/{radar-I7S5WNFK-Pf_KiQJM.js → radar-I7S5WNFK-BW0V-EGR.js} +1 -1
- package/console-app/assets/{railroad-3IZDKUUU-BYoOMoQY.js → railroad-3IZDKUUU-FiTHaDbb.js} +1 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-lmUjOixE.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-ZjdA7OHp.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-VHSlvwI8.js +1 -0
- package/console-app/assets/{railroadDiagram-AXF67PYL-Di8N9tHD.js → railroadDiagram-AXF67PYL-9ef7j5U7.js} +1 -1
- package/console-app/assets/{requirementDiagram-LRYGKXZP-2yZZ753q.js → requirementDiagram-LRYGKXZP-Cu90DbEZ.js} +1 -1
- package/console-app/assets/{sankeyDiagram-W5VNT64P-BwYA-xq1.js → sankeyDiagram-W5VNT64P-Bhxmyxaw.js} +1 -1
- package/console-app/assets/{sequenceDiagram-SI44F4Z6-odIxlx8J.js → sequenceDiagram-SI44F4Z6-CBsbRTz8.js} +1 -1
- package/console-app/assets/{src-CxJwpjvz.js → src-BR8qR3lM.js} +1 -1
- package/console-app/assets/{stateDiagram-OKZ733FA-Du2S0qU9.js → stateDiagram-OKZ733FA-Dr0frETZ.js} +1 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-BSXWhCvf.js +1 -0
- package/console-app/assets/{swimlanes-SLNWSIFB-JZ3swzI2.js → swimlanes-SLNWSIFB-CXMjvd_a.js} +1 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-BUdsPDKC.js +8 -0
- package/console-app/assets/{timeline-definition-Z64GVDOM-CsppAEWi.js → timeline-definition-Z64GVDOM-DpmEZPV0.js} +1 -1
- package/console-app/assets/{treeView-QDETBFTQ-DkkO8peQ.js → treeView-QDETBFTQ-CjmuinMk.js} +1 -1
- package/console-app/assets/{treemap-6X3UGDF4-hjLkPCJI.js → treemap-6X3UGDF4-BP_fU6Cn.js} +1 -1
- package/console-app/assets/{vennDiagram-T6HMQDX7-BOfgM1xp.js → vennDiagram-T6HMQDX7-DgZS7iuW.js} +1 -1
- package/console-app/assets/{wardley-OPB4EBWU-C5ZtGfBa.js → wardley-OPB4EBWU-CgMPoouN.js} +1 -1
- package/console-app/assets/{wardleyDiagram-T6FBY63Y-ymf3Vm6A.js → wardleyDiagram-T6FBY63Y-6y-xxP1R.js} +1 -1
- package/console-app/assets/{xychartDiagram-ELKLHX3M-DdxXIoKz.js → xychartDiagram-ELKLHX3M-DOeIQjYI.js} +1 -1
- package/console-app/index.html +1 -1
- package/dist/.pikku/addon/index.d.ts +1 -1
- package/dist/.pikku/addon/index.js +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
- package/dist/.pikku/agent/index.d.ts +1 -1
- package/dist/.pikku/agent/index.js +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/auth/index.d.ts +1 -1
- package/dist/.pikku/auth/index.js +1 -1
- package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +9 -2
- package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
- package/dist/.pikku/channel/index.d.ts +1 -1
- package/dist/.pikku/channel/index.js +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/index.d.ts +1 -1
- package/dist/.pikku/cli/index.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +1 -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-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.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.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/error/index.d.ts +1 -1
- package/dist/.pikku/error/index.js +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/function/index.d.ts +1 -1
- package/dist/.pikku/function/index.js +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +12 -2
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +3 -3
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/gateway/index.d.ts +1 -1
- package/dist/.pikku/gateway/index.js +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
- package/dist/.pikku/http/index.d.ts +1 -1
- package/dist/.pikku/http/index.js +1 -1
- 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/mcp/index.d.ts +1 -1
- package/dist/.pikku/mcp/index.js +1 -1
- 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/middleware/index.d.ts +1 -1
- package/dist/.pikku/middleware/index.js +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +9 -2
- package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/queue/index.d.ts +1 -1
- package/dist/.pikku/queue/index.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/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/scenarios/index.d.ts +1 -1
- package/dist/.pikku/scenarios/index.js +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/index.d.ts +1 -1
- package/dist/.pikku/scheduler/index.js +1 -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 +1 -1
- package/dist/.pikku/scopes/index.d.ts +1 -1
- package/dist/.pikku/scopes/index.js +1 -1
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/index.d.ts +1 -1
- package/dist/.pikku/secrets/index.js +1 -1
- 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/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/setup/index.d.ts +1 -1
- package/dist/.pikku/setup/index.js +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/trigger/index.d.ts +1 -1
- package/dist/.pikku/trigger/index.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/index.d.ts +1 -1
- package/dist/.pikku/variables/index.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/index.d.ts +1 -1
- package/dist/.pikku/workflow/index.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/deploy/analyzer/analyzer.d.ts +1 -1
- package/dist/src/deploy/analyzer/index.d.ts +0 -1
- package/dist/src/deploy/build-pipeline.d.ts +2 -2
- package/dist/src/deploy/bundler/types.d.ts +1 -1
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +1 -1
- package/dist/src/deploy/plan/executor.d.ts +1 -1
- package/dist/src/deploy/plan/planner.d.ts +1 -1
- package/dist/src/deploy/plan/provider.d.ts +1 -1
- package/dist/src/deploy/server-entry.d.ts +1 -1
- package/dist/src/fabric/fabric-commands.d.ts +3 -3
- package/dist/src/fabric/functions/llm-key.function.d.ts +4 -4
- package/dist/src/functions/commands/db-generate.js +1 -1
- package/dist/src/functions/commands/deploy-apply.d.ts +1 -1
- package/dist/src/functions/commands/new-addon.js +14 -12
- package/dist/src/functions/commands/persona.js +6 -0
- package/dist/src/functions/db/better-auth-schema.js +5 -0
- package/dist/src/functions/db/local-db.d.ts +11 -3
- package/dist/src/functions/db/local-db.js +17 -8
- package/dist/src/functions/wirings/auth/serialize-auth-guards.d.ts +1 -1
- package/dist/src/functions/wirings/auth/serialize-auth-guards.js +9 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +2 -2
- package/dist/src/functions/wirings/functions/serialize-function-types.js +11 -1
- package/dist/src/functions/wirings/middleware/serialize-middleware-types.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/serialize-middleware-types.js +10 -2
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.js +485 -102
- package/dist/src/utils/pikku-cli-config-error.d.ts +9 -0
- package/dist/src/utils/pikku-cli-config-error.js +9 -0
- package/dist/src/utils/pikku-cli-config.d.ts +2 -3
- package/dist/src/utils/pikku-cli-config.js +2 -3
- package/dist/src/utils/resolve-scaffold-feature.d.ts +6 -0
- package/dist/src/utils/resolve-scaffold-feature.js +22 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/surface.json +4 -26
- package/console-app/assets/architecture-TIHT7OUA-5QhJKy4P.js +0 -1
- package/console-app/assets/channel-DoE3nnYB.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-BDALKVU4.js +0 -1
- package/console-app/assets/classDiagram-JCYQIIEL-BgrrHQtN.js +0 -1
- package/console-app/assets/classDiagram-v2-OCEON4UE-BgrrHQtN.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-D2SxzJUl.js +0 -1
- package/console-app/assets/flowDiagram-UKHOOZJN-CQXuJ0z2.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-CCRXsRRD.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-DVRSVgn8.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-COUBoNH3.js +0 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-CTXOGDRR.js +0 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-DRrggQgK.js +0 -8
- package/dist/src/deploy/analyzer/manifest.d.ts +0 -170
- package/dist/src/deploy/analyzer/manifest.js +0 -8
- package/dist/src/deploy/provider-adapter.d.ts +0 -176
- package/dist/src/deploy/provider-adapter.js +0 -10
|
@@ -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.112
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow';
|
|
5
5
|
import type { PikkuWorkflowGraphConfig, PikkuWorkflowGraphResult } from '@pikku/core/workflow';
|
package/dist/bin/pikku-bin.mjs
CHANGED
|
@@ -11,8 +11,8 @@ async function checkForUpdate() {
|
|
|
11
11
|
})
|
|
12
12
|
if (!res.ok) return
|
|
13
13
|
const { version: latest } = await res.json()
|
|
14
|
-
if (latest !== '0.12.
|
|
15
|
-
process.stderr.write(`\n Update available 0.12.
|
|
14
|
+
if (latest !== '0.12.112') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.112 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Workflow orchestrators dispatch to step units via queue or RPC (inline).
|
|
8
8
|
*/
|
|
9
9
|
import { type InspectorState } from '@pikku/inspector';
|
|
10
|
-
import type { DeploymentManifest } from '
|
|
10
|
+
import type { DeploymentManifest } from '@pikku/deploy';
|
|
11
11
|
export interface AnalyzerOptions {
|
|
12
12
|
projectId: string;
|
|
13
13
|
/** Services that can't run serverless — functions using them get target: 'server' */
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { analyzeDeployment } from './analyzer.js';
|
|
2
2
|
export type { AnalyzerOptions } from './analyzer.js';
|
|
3
|
-
export type { DeploymentManifest, DeploymentUnit, DeploymentUnitRole, ServiceCapability, ServiceRequirement, HttpRouteInfo, QueueDefinition, ScheduledTaskDefinition, ChannelDefinition, AgentDefinition, MCPEndpointDefinition, WorkflowStepDefinition, WorkflowDefinition, SecretDeclaration, VariableDeclaration, } from './manifest.js';
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { InspectorState } from '@pikku/inspector';
|
|
8
8
|
import { PikkuError } from '@pikku/core/errors';
|
|
9
|
-
import type { DeploymentManifest } from '
|
|
9
|
+
import type { DeploymentManifest } from '@pikku/deploy';
|
|
10
10
|
import type { Bundler } from './bundler/bundler.interface.js';
|
|
11
11
|
import type { BundleResult } from './bundler/types.js';
|
|
12
|
-
import type { ProviderAdapter } from '
|
|
12
|
+
import type { ProviderAdapter } from '@pikku/deploy';
|
|
13
13
|
export interface BuildLogger {
|
|
14
14
|
info(msg: string): void;
|
|
15
15
|
error(msg: string): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Types for the Pikku esbuild bundling pipeline.
|
|
3
3
|
* Imports DeploymentManifest from the analyzer — single source of truth.
|
|
4
4
|
*/
|
|
5
|
-
export type { DeploymentManifest, DeploymentUnit, DeploymentUnitRole, } from '
|
|
5
|
+
export type { DeploymentManifest, DeploymentUnit, DeploymentUnitRole, } from '@pikku/deploy';
|
|
6
6
|
export interface BundleResult {
|
|
7
7
|
unitName: string;
|
|
8
8
|
bundlePath: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Uses --stateInput to avoid re-inspecting the codebase for each unit.
|
|
9
9
|
*/
|
|
10
10
|
import type { InspectorState } from '@pikku/inspector';
|
|
11
|
-
import type { DeploymentManifest, DeploymentUnit } from '
|
|
11
|
+
import type { DeploymentManifest, DeploymentUnit } from '@pikku/deploy';
|
|
12
12
|
export interface PerUnitCodegenOptions {
|
|
13
13
|
/** Root directory of the project (where pikku.config.json lives) */
|
|
14
14
|
projectDir: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeploymentManifest } from '
|
|
1
|
+
import type { DeploymentManifest } from '@pikku/deploy';
|
|
2
2
|
import type { DeployProvider } from './provider.js';
|
|
3
3
|
import type { ApplyResult, DeploymentPlan, PlanChange } from './types.js';
|
|
4
4
|
type ProgressStatus = 'start' | 'done' | 'error';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeploymentManifest } from '
|
|
1
|
+
import type { DeploymentManifest } from '@pikku/deploy';
|
|
2
2
|
import type { CurrentState, DeployProvider } from './provider.js';
|
|
3
3
|
import type { DeploymentPlan } from './types.js';
|
|
4
4
|
export declare function generatePlan(manifest: DeploymentManifest, currentState: CurrentState, provider: DeployProvider): Promise<DeploymentPlan>;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* fly.io, ECS, bare VM. Provider-specific config (Dockerfile, infra) is
|
|
11
11
|
* emitted by the provider adapter on top of this entry + bundle.js.
|
|
12
12
|
*/
|
|
13
|
-
import type { EntryGenerationContext } from '
|
|
13
|
+
import type { EntryGenerationContext } from '@pikku/deploy';
|
|
14
14
|
export declare function generateServerEntrySource(ctx: EntryGenerationContext): string;
|
|
15
15
|
export declare const SERVER_DOCKERFILE = "# Generated by @pikku/cli \u2014 do not edit\n# Full image (not -slim): carries the build toolchain so externalised deps with\n# native addons can compile from source at `npm install` time.\nFROM node:26\n\nRUN apt-get update \\\n && apt-get install -y --no-install-recommends tini ca-certificates \\\n && rm -rf /var/lib/apt/lists/*\n\nRUN groupadd -r pikku && useradd -r -g pikku -u 1001 pikku\n\nWORKDIR /app\n\n# Pikku bundles user code + first-party deps inline; only externalised deps\n# (typically empty for pure-JS apps) are listed in package.json. We ship no\n# lockfile because the bundle has already pinned everything via the\n# extracted exact-dependencies \u2014 `npm install --omit=dev` resolves the\n# leftover externals (if any) at build time.\nCOPY --chown=pikku:pikku package.json ./\nRUN npm install --omit=dev --no-audit --no-fund\n\nCOPY --chown=pikku:pikku bundle.js ./\n\nUSER pikku\nENV NODE_ENV=production\nENV PORT=8080\nEXPOSE 8080\n\nENTRYPOINT [\"/usr/bin/tini\", \"--\"]\nCMD [\"node\", \"bundle.js\"]\n";
|
|
16
16
|
export declare const SERVER_DOCKERIGNORE = "node_modules\n.git\n*.log\nmetafile.json\nexact-dependencies.json\n";
|
|
@@ -698,7 +698,7 @@ export declare const fabricCommands: {
|
|
|
698
698
|
}, {
|
|
699
699
|
proxyUrl: string;
|
|
700
700
|
apiKey: string;
|
|
701
|
-
format: "
|
|
701
|
+
format: "text" | "json" | "env" | "shell";
|
|
702
702
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
|
|
703
703
|
shell?: boolean | undefined;
|
|
704
704
|
env?: boolean | undefined;
|
|
@@ -706,7 +706,7 @@ export declare const fabricCommands: {
|
|
|
706
706
|
}, {
|
|
707
707
|
proxyUrl: string;
|
|
708
708
|
apiKey: string;
|
|
709
|
-
format: "
|
|
709
|
+
format: "text" | "json" | "env" | "shell";
|
|
710
710
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
|
|
711
711
|
shell?: boolean | undefined;
|
|
712
712
|
env?: boolean | undefined;
|
|
@@ -714,7 +714,7 @@ export declare const fabricCommands: {
|
|
|
714
714
|
}, {
|
|
715
715
|
proxyUrl: string;
|
|
716
716
|
apiKey: string;
|
|
717
|
-
format: "
|
|
717
|
+
format: "text" | "json" | "env" | "shell";
|
|
718
718
|
}, "rpc" | "session", import("../../.pikku/function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>, import("../../.pikku/middleware/pikku-middleware-types.gen.js").PikkuMiddleware, (services: import("../../types/application-types.js").SingletonServices, data: any, session?: import("../../types/application-types.js").UserSession | undefined) => void | Promise<void>, string>;
|
|
719
719
|
};
|
|
720
720
|
};
|
|
@@ -8,8 +8,8 @@ export declare const FabricLLMKeyOutput: z.ZodObject<{
|
|
|
8
8
|
proxyUrl: z.ZodString;
|
|
9
9
|
apiKey: z.ZodString;
|
|
10
10
|
format: z.ZodEnum<{
|
|
11
|
-
json: "json";
|
|
12
11
|
text: "text";
|
|
12
|
+
json: "json";
|
|
13
13
|
env: "env";
|
|
14
14
|
shell: "shell";
|
|
15
15
|
}>;
|
|
@@ -21,7 +21,7 @@ export declare const FabricLLMKey: import("../../../.pikku/function/pikku-functi
|
|
|
21
21
|
}, {
|
|
22
22
|
proxyUrl: string;
|
|
23
23
|
apiKey: string;
|
|
24
|
-
format: "
|
|
24
|
+
format: "text" | "json" | "env" | "shell";
|
|
25
25
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
|
|
26
26
|
shell?: boolean | undefined;
|
|
27
27
|
env?: boolean | undefined;
|
|
@@ -29,7 +29,7 @@ export declare const FabricLLMKey: import("../../../.pikku/function/pikku-functi
|
|
|
29
29
|
}, {
|
|
30
30
|
proxyUrl: string;
|
|
31
31
|
apiKey: string;
|
|
32
|
-
format: "
|
|
32
|
+
format: "text" | "json" | "env" | "shell";
|
|
33
33
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown> | import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
|
|
34
34
|
shell?: boolean | undefined;
|
|
35
35
|
env?: boolean | undefined;
|
|
@@ -37,7 +37,7 @@ export declare const FabricLLMKey: import("../../../.pikku/function/pikku-functi
|
|
|
37
37
|
}, {
|
|
38
38
|
proxyUrl: string;
|
|
39
39
|
apiKey: string;
|
|
40
|
-
format: "
|
|
40
|
+
format: "text" | "json" | "env" | "shell";
|
|
41
41
|
}, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>;
|
|
42
42
|
export declare const renderLLMKey: (_services: unknown, data: {
|
|
43
43
|
proxyUrl: string;
|
|
@@ -14,7 +14,7 @@ export const dbGenerate = pikkuSessionlessFunc({
|
|
|
14
14
|
}
|
|
15
15
|
const state = await getInspectorState();
|
|
16
16
|
const addons = [...state.rpc.wireAddonDeclarations.values()].map(({ package: pkg, remote }) => ({ package: pkg, remote }));
|
|
17
|
-
const { upToDate, written } = await generateMigrations(resolved, config.rootDir, config.srcDirectories, logger, addons);
|
|
17
|
+
const { upToDate, written } = await generateMigrations(resolved, config.rootDir, config.srcDirectories, logger, addons, state.serviceAggregation.requiredServices);
|
|
18
18
|
for (const source of upToDate) {
|
|
19
19
|
logger.info(`db generate: ${source} is already covered by existing migrations`);
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProviderAdapter, EntryGenerationContext } from '
|
|
1
|
+
import type { ProviderAdapter, EntryGenerationContext } from '@pikku/deploy';
|
|
2
2
|
import type { InspectorState } from '@pikku/inspector';
|
|
3
3
|
export declare function getEntryContext(unitDir: string, pikkuDir: string, unit: EntryGenerationContext['unit'], inspectorState: InspectorState): EntryGenerationContext;
|
|
4
4
|
export declare function resolveProvider(config?: {
|
|
@@ -139,17 +139,20 @@ export function getAddonFiles(vars, flags) {
|
|
|
139
139
|
// these never have to point at the source tree.
|
|
140
140
|
imports: {
|
|
141
141
|
'#pikku/*.js': './dist/.pikku/*.js',
|
|
142
|
-
'#pikku/*': './dist/.pikku/*/index.js',
|
|
142
|
+
'#pikku/*': ['./dist/.pikku/*/index.js', './dist/.pikku/*'],
|
|
143
143
|
},
|
|
144
|
+
// An addon's generated tree roots at `.pikku/addon/`, but a consumer
|
|
145
|
+
// reaches it by the same subpath an application would — the leaf is the
|
|
146
|
+
// package's business, not its callers'.
|
|
144
147
|
exports: {
|
|
145
148
|
'.': {
|
|
146
149
|
types: './dist/src/index.d.ts',
|
|
147
150
|
import: './dist/src/index.js',
|
|
148
151
|
},
|
|
149
|
-
'./.pikku/*': './dist/.pikku/*',
|
|
150
|
-
'./.pikku/pikku-metadata.gen.json': './dist/.pikku/pikku-metadata.gen.json',
|
|
152
|
+
'./.pikku/*': './dist/.pikku/addon/*',
|
|
153
|
+
'./.pikku/pikku-metadata.gen.json': './dist/.pikku/addon/pikku-metadata.gen.json',
|
|
151
154
|
'./.pikku/rpc/pikku-rpc-wirings-map.internal.gen.js': {
|
|
152
|
-
types: './dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts',
|
|
155
|
+
types: './dist/.pikku/addon/rpc/pikku-rpc-wirings-map.internal.gen.d.ts',
|
|
153
156
|
},
|
|
154
157
|
},
|
|
155
158
|
files: ['dist'],
|
|
@@ -204,7 +207,7 @@ export function getAddonFiles(vars, flags) {
|
|
|
204
207
|
resolveJsonModule: true,
|
|
205
208
|
paths: {
|
|
206
209
|
'#pikku/*.js': ['./.pikku/*.ts'],
|
|
207
|
-
'#pikku/*': ['./.pikku/*/index.ts'],
|
|
210
|
+
'#pikku/*': ['./.pikku/*/index.ts', './.pikku/*'],
|
|
208
211
|
},
|
|
209
212
|
},
|
|
210
213
|
include: ['src/**/*', 'types/**/*', '.pikku/**/*.ts'],
|
|
@@ -322,15 +325,14 @@ export const createSingletonServices = pikkuAddonServices(async (
|
|
|
322
325
|
`;
|
|
323
326
|
}
|
|
324
327
|
else {
|
|
328
|
+
// The plain service takes no constructor argument — the secret, credential
|
|
329
|
+
// and oauth variants are the ones handed something to authenticate with.
|
|
325
330
|
files['src/services.ts'] =
|
|
326
331
|
`import { ${pascalName}Service } from './${name}-api.service.js'
|
|
327
332
|
import { pikkuAddonServices } from '#pikku/addon/setup'
|
|
328
333
|
|
|
329
|
-
export const createSingletonServices = pikkuAddonServices(async (
|
|
330
|
-
|
|
331
|
-
{ variables }
|
|
332
|
-
) => {
|
|
333
|
-
const ${camelName} = new ${pascalName}Service(variables)
|
|
334
|
+
export const createSingletonServices = pikkuAddonServices(async () => {
|
|
335
|
+
const ${camelName} = new ${pascalName}Service()
|
|
334
336
|
|
|
335
337
|
return { ${camelName} }
|
|
336
338
|
})
|
|
@@ -688,7 +690,7 @@ export function getTestFiles(vars) {
|
|
|
688
690
|
type: 'module',
|
|
689
691
|
imports: {
|
|
690
692
|
'#pikku/*.js': './.pikku/*.ts',
|
|
691
|
-
'#pikku/*': './.pikku/*/index.ts',
|
|
693
|
+
'#pikku/*': ['./.pikku/*/index.ts', './.pikku/*'],
|
|
692
694
|
},
|
|
693
695
|
scripts: {
|
|
694
696
|
pretest: 'pikku all',
|
|
@@ -727,7 +729,7 @@ export function getTestFiles(vars) {
|
|
|
727
729
|
types: ['node'],
|
|
728
730
|
paths: {
|
|
729
731
|
'#pikku/*.js': ['./.pikku/*.ts'],
|
|
730
|
-
'#pikku/*': ['./.pikku/*/index.ts'],
|
|
732
|
+
'#pikku/*': ['./.pikku/*/index.ts', './.pikku/*'],
|
|
731
733
|
},
|
|
732
734
|
},
|
|
733
735
|
include: ['src/*', '.pikku/**/*', 'types/**/*'],
|
|
@@ -3,6 +3,7 @@ import { mkdirSync, writeFileSync } from 'node:fs';
|
|
|
3
3
|
import { pikkuSessionlessFunc } from '#pikku/function';
|
|
4
4
|
import { createHttpPersonas, personaEnvironmentRefusal, roleMismatchMessage, verifyPersonaRoles, } from '@pikku/core/persona';
|
|
5
5
|
import { personaVirtualUserTarget, runVirtualUser, catalogueClassification, DISPOSITIONS, prepareVirtualUserRun, } from '@pikku/core/virtual-user';
|
|
6
|
+
import { getSingletonServices, setSingletonServices } from '@pikku/core/state';
|
|
6
7
|
import { resolvePersonas } from '../../utils/resolve-personas.js';
|
|
7
8
|
import { resolveEnvironment } from './environment.js';
|
|
8
9
|
import { createDevAgentRunner } from './dev-agent-runner.js';
|
|
@@ -92,6 +93,11 @@ export const personaRun = pikkuSessionlessFunc({
|
|
|
92
93
|
if (!agentRunner) {
|
|
93
94
|
throw new Error('No AI provider is configured. Set OPENAI_BASE_URL + OPENAI_API_KEY (or LITELLM_PROXY_URL + LITELLM_API_KEY).');
|
|
94
95
|
}
|
|
96
|
+
// `talkTo` reaches the runner through the singleton registry rather than
|
|
97
|
+
// through the `llm` handed to the engine, so a persona offered an agent
|
|
98
|
+
// dies on its first word without this — and only for a persona whose
|
|
99
|
+
// scopes reach one, which is why it survives a run as anybody else.
|
|
100
|
+
setSingletonServices({ ...getSingletonServices(), agentRunner });
|
|
95
101
|
// Shared with the scaffolded `runVirtualUser` RPC, which does the same
|
|
96
102
|
// derivation from `metaService` at runtime — the two have to agree, or the
|
|
97
103
|
// same persona and seed explore a different API depending on how it was
|
|
@@ -97,6 +97,11 @@ function fakeSecretService() {
|
|
|
97
97
|
const placeholder = 'schema-introspection-only';
|
|
98
98
|
return {
|
|
99
99
|
getSecret: async () => createSecretValue(placeholder),
|
|
100
|
+
// Every key resolves, for the same reason `hasSecret` says yes to all of
|
|
101
|
+
// them: an auth factory that batches its secrets must come back with the
|
|
102
|
+
// whole batch, or it throws on the one it considers required and the
|
|
103
|
+
// schema is never read at all.
|
|
104
|
+
getSecrets: async (keys) => Object.fromEntries(keys.map((key) => [key, createSecretValue(placeholder)])),
|
|
100
105
|
hasSecret: async () => true,
|
|
101
106
|
setSecret: async () => { },
|
|
102
107
|
};
|
|
@@ -197,10 +197,18 @@ export interface DesiredRuntimeSchema extends DesiredSchema {
|
|
|
197
197
|
* scope tables, so the schemas that wanted them are left out and returned in
|
|
198
198
|
* `skipped` — reported rather than dropped, because the tables they would have
|
|
199
199
|
* recognised now have nothing to explain them.
|
|
200
|
+
*
|
|
201
|
+
* `services` narrows the declaration to the schemas the services a project's
|
|
202
|
+
* code actually reaches own, for the caller that is about to write a migration:
|
|
203
|
+
* a project with no agents should not carry `agent_threads` in its migrations
|
|
204
|
+
* forever. Omit it and the whole declaration answers, which is what the caller
|
|
205
|
+
* that is *recognising* tables wants — a table created by a service that has
|
|
206
|
+
* since been dropped still has to read as a runtime table rather than as an
|
|
207
|
+
* unexplained one.
|
|
200
208
|
*/
|
|
201
209
|
export declare function desiredRuntimeSchema(resolved: ResolvedDb, rootDir: string, srcDirectories: string[], logger: {
|
|
202
210
|
error: (msg: string) => void;
|
|
203
|
-
}): Promise<DesiredRuntimeSchema>;
|
|
211
|
+
}, services?: ReadonlySet<string>): Promise<DesiredRuntimeSchema>;
|
|
204
212
|
export declare function introspectSchema(resolved: ResolvedDb): Promise<SchemaMap>;
|
|
205
213
|
export interface SchemaDriftResult {
|
|
206
214
|
/** In the migrations, absent from the database — it is behind. */
|
|
@@ -367,7 +375,7 @@ export declare function addonSchemaSources(rootDir: string, dialect: ResolvedDb[
|
|
|
367
375
|
*/
|
|
368
376
|
export declare function schemaSources(resolved: ResolvedDb, rootDir: string, srcDirectories: string[], logger: {
|
|
369
377
|
error: (msg: string) => void;
|
|
370
|
-
}, addons?: AddonDeclaration[]): Promise<SchemaSource[]>;
|
|
378
|
+
}, addons?: AddonDeclaration[], services?: ReadonlySet<string>): Promise<SchemaSource[]>;
|
|
371
379
|
export interface GeneratedMigration {
|
|
372
380
|
source: string;
|
|
373
381
|
file: string;
|
|
@@ -402,5 +410,5 @@ export interface GenerateResult {
|
|
|
402
410
|
*/
|
|
403
411
|
export declare function generateMigrations(resolved: ResolvedDb, rootDir: string, srcDirectories: string[], logger: {
|
|
404
412
|
error: (msg: string) => void;
|
|
405
|
-
}, addons?: AddonDeclaration[]): Promise<GenerateResult>;
|
|
413
|
+
}, addons?: AddonDeclaration[], services?: ReadonlySet<string>): Promise<GenerateResult>;
|
|
406
414
|
export {};
|
|
@@ -6,7 +6,7 @@ import { runInNewContext } from 'node:vm';
|
|
|
6
6
|
import { transformSync } from 'esbuild';
|
|
7
7
|
import { CamelCasePlugin, Kysely, PostgresDialect } from 'kysely';
|
|
8
8
|
import { migrate, baselineMigrations, } from './db-migrator.js';
|
|
9
|
-
import { applyPikkuSchemas, compilePikkuSchemas, pikkuSchemas, resolveRequirements, createCoercionPlugin, } from '@pikku/kysely';
|
|
9
|
+
import { applyPikkuSchemas, compilePikkuSchemas, pikkuSchemas, requiredPikkuSchemas, resolveRequirements, createCoercionPlugin, } from '@pikku/kysely';
|
|
10
10
|
import { loadAuthOptions, getAuthMigrations } from './better-auth-schema.js';
|
|
11
11
|
import { generateSchemaTypes } from './db-codegen.js';
|
|
12
12
|
import { generateZodTypes } from './zod-codegen.js';
|
|
@@ -797,13 +797,22 @@ async function applyAuthSchema(kysely, rootDir, srcDirectories, logger) {
|
|
|
797
797
|
* scope tables, so the schemas that wanted them are left out and returned in
|
|
798
798
|
* `skipped` — reported rather than dropped, because the tables they would have
|
|
799
799
|
* recognised now have nothing to explain them.
|
|
800
|
+
*
|
|
801
|
+
* `services` narrows the declaration to the schemas the services a project's
|
|
802
|
+
* code actually reaches own, for the caller that is about to write a migration:
|
|
803
|
+
* a project with no agents should not carry `agent_threads` in its migrations
|
|
804
|
+
* forever. Omit it and the whole declaration answers, which is what the caller
|
|
805
|
+
* that is *recognising* tables wants — a table created by a service that has
|
|
806
|
+
* since been dropped still has to read as a runtime table rather than as an
|
|
807
|
+
* unexplained one.
|
|
800
808
|
*/
|
|
801
|
-
export async function desiredRuntimeSchema(resolved, rootDir, srcDirectories, logger) {
|
|
809
|
+
export async function desiredRuntimeSchema(resolved, rootDir, srcDirectories, logger, services) {
|
|
810
|
+
const declared = services ? requiredPikkuSchemas(services) : pikkuSchemas;
|
|
802
811
|
const skipped = [];
|
|
803
812
|
const collect = async (db, introspect) => {
|
|
804
813
|
await applyAuthSchema(db, rootDir, srcDirectories, logger);
|
|
805
814
|
const before = await introspect();
|
|
806
|
-
const { types, unmet } = await resolveRequirements(db);
|
|
815
|
+
const { types, unmet } = await resolveRequirements(db, declared);
|
|
807
816
|
for (const { schema, requirement } of unmet) {
|
|
808
817
|
skipped.push({
|
|
809
818
|
schema: schema.name,
|
|
@@ -812,7 +821,7 @@ export async function desiredRuntimeSchema(resolved, rootDir, srcDirectories, lo
|
|
|
812
821
|
});
|
|
813
822
|
}
|
|
814
823
|
const unavailable = new Set(unmet.map(({ schema }) => schema.name));
|
|
815
|
-
const schemas =
|
|
824
|
+
const schemas = declared.filter((s) => !unavailable.has(s.name));
|
|
816
825
|
await applyPikkuSchemas(db, schemas);
|
|
817
826
|
const after = await introspect();
|
|
818
827
|
for (const table of before.keys())
|
|
@@ -1109,7 +1118,7 @@ export async function addonSchemaSources(rootDir, dialect, addons, logger) {
|
|
|
1109
1118
|
* Auth comes first because the runtime's scope tables reference its `user`
|
|
1110
1119
|
* table; addons come last because they may reference either.
|
|
1111
1120
|
*/
|
|
1112
|
-
export async function schemaSources(resolved, rootDir, srcDirectories, logger, addons = []) {
|
|
1121
|
+
export async function schemaSources(resolved, rootDir, srcDirectories, logger, addons = [], services) {
|
|
1113
1122
|
const sources = [];
|
|
1114
1123
|
const auth = await desiredAuthSchema(resolved, rootDir, srcDirectories, logger);
|
|
1115
1124
|
if (auth) {
|
|
@@ -1119,7 +1128,7 @@ export async function schemaSources(resolved, rootDir, srcDirectories, logger, a
|
|
|
1119
1128
|
origin: 'pikkuBetterAuth (Better Auth)',
|
|
1120
1129
|
});
|
|
1121
1130
|
}
|
|
1122
|
-
const runtime = await desiredRuntimeSchema(resolved, rootDir, srcDirectories, logger);
|
|
1131
|
+
const runtime = await desiredRuntimeSchema(resolved, rootDir, srcDirectories, logger, services);
|
|
1123
1132
|
if (runtime.tables.size > 0) {
|
|
1124
1133
|
sources.push({
|
|
1125
1134
|
name: 'pikku-runtime',
|
|
@@ -1185,8 +1194,8 @@ function addColumnStatements(table, columns) {
|
|
|
1185
1194
|
* Migrations are written one file per source, numbered in dependency order, so
|
|
1186
1195
|
* a project can review and apply them independently.
|
|
1187
1196
|
*/
|
|
1188
|
-
export async function generateMigrations(resolved, rootDir, srcDirectories, logger, addons = []) {
|
|
1189
|
-
const sources = await schemaSources(resolved, rootDir, srcDirectories, logger, addons);
|
|
1197
|
+
export async function generateMigrations(resolved, rootDir, srcDirectories, logger, addons = [], services) {
|
|
1198
|
+
const sources = await schemaSources(resolved, rootDir, srcDirectories, logger, addons, services);
|
|
1190
1199
|
const result = { upToDate: [], written: [] };
|
|
1191
1200
|
for (const source of sources) {
|
|
1192
1201
|
// Re-read after each write: a migration just written for an earlier source
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* references it; that config imports it back, which is a type-only edge and
|
|
10
10
|
* carries no runtime cycle.
|
|
11
11
|
*/
|
|
12
|
-
export declare const serializeAuthGuards: (functionTypesImportPath: string, packageName?: string) => string;
|
|
12
|
+
export declare const serializeAuthGuards: (functionTypesImportPath: string, requiredServicesTypeImport: string, packageName?: string) => string;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* references it; that config imports it back, which is a type-only edge and
|
|
10
10
|
* carries no runtime cycle.
|
|
11
11
|
*/
|
|
12
|
-
export const serializeAuthGuards = (functionTypesImportPath, packageName) => {
|
|
12
|
+
export const serializeAuthGuards = (functionTypesImportPath, requiredServicesTypeImport, packageName) => {
|
|
13
13
|
const packageNameValue = packageName ? `'${packageName}'` : 'null';
|
|
14
14
|
return `/**
|
|
15
15
|
* Permission, auth gate and credential definitions
|
|
@@ -29,11 +29,18 @@ import type {
|
|
|
29
29
|
Session,
|
|
30
30
|
SingletonServices,
|
|
31
31
|
WiredServices,
|
|
32
|
-
WiredSingletonServices,
|
|
33
32
|
} from '${functionTypesImportPath}'
|
|
33
|
+
${requiredServicesTypeImport}
|
|
34
34
|
|
|
35
35
|
export { defineCredential } from '@pikku/core/credential'
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Derived here rather than imported: nothing outside a generated leaf ever
|
|
39
|
+
* names this intersection, so the function leaf keeps it to itself and the
|
|
40
|
+
* leaves that want it spell it out.
|
|
41
|
+
*/
|
|
42
|
+
type WiredSingletonServices = RequiredSingletonServices & SingletonServices
|
|
43
|
+
|
|
37
44
|
/** \`WiredSingletonServices\` without \`secrets\`, for auth gates. */
|
|
38
45
|
type WiredAuthServices = SecretlessServices<WiredSingletonServices>
|
|
39
46
|
|
|
@@ -32,11 +32,11 @@ export const pikkuFunctionTypesSplit = pikkuSessionlessFunc({
|
|
|
32
32
|
? `import type { ${pikkuConfigType.type} } from '${getFileImportRelativePath(functionTypesFile, pikkuConfigType.typePath, packageMappings)}'`
|
|
33
33
|
: '// Config type not found, will use fallback';
|
|
34
34
|
const content = serializeFunctionTypes(`import type { ${userSessionType.type} } from '${getFileImportRelativePath(functionTypesFile, userSessionType.typePath, packageMappings)}'`, userSessionType.type, `import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(functionTypesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, `import type { ${wireServicesType.type} } from '${getFileImportRelativePath(functionTypesFile, wireServicesType.typePath, packageMappings)}'`, wireServicesType.type, `import type { TypedPikkuRPC, FlattenedRPCMap } from '${getFileImportRelativePath(functionTypesFile, rpcInternalMapDeclarationFile, packageMappings)}'`, `import type { RequiredSingletonServices } from '${getFileImportRelativePath(functionTypesFile, servicesFile, packageMappings)}'`, configTypeImport, getFileImportRelativePath(functionTypesFile, authGuardsFile, packageMappings), undefined, typeof config.addon === 'object' ? config.addon?.categories : undefined, `import type { ScopeId } from '${getFileImportRelativePath(functionTypesFile, config.scopesFile, packageMappings)}'`, credentialsTypeImport, getFileImportRelativePath(functionTypesFile, middlewareTypesFile, packageMappings), { addon: !!config.addon });
|
|
35
|
-
await writeFileInDir(logger, middlewareTypesFile, serializeMiddlewareTypes(getFileImportRelativePath(middlewareTypesFile, functionTypesFile, packageMappings), config.addonName));
|
|
35
|
+
await writeFileInDir(logger, middlewareTypesFile, serializeMiddlewareTypes(getFileImportRelativePath(middlewareTypesFile, functionTypesFile, packageMappings), `import type { RequiredSingletonServices } from '${getFileImportRelativePath(middlewareTypesFile, servicesFile, packageMappings)}'`, config.addonName));
|
|
36
36
|
await writeFileInDir(logger, setupTypesFile, serializeSetupTypes(getFileImportRelativePath(setupTypesFile, functionTypesFile, packageMappings), pikkuConfigType
|
|
37
37
|
? `import type { ${pikkuConfigType.type} } from '${getFileImportRelativePath(setupTypesFile, pikkuConfigType.typePath, packageMappings)}'`
|
|
38
38
|
: '// Config type not found, will use fallback', pikkuConfigType?.type, `import type { RequiredSingletonServices, RequiredWireServices } from '${getFileImportRelativePath(setupTypesFile, servicesFile, packageMappings)}'`));
|
|
39
|
-
await writeFileInDir(logger, authGuardsFile, serializeAuthGuards(getFileImportRelativePath(authGuardsFile, functionTypesFile, packageMappings), config.addonName));
|
|
39
|
+
await writeFileInDir(logger, authGuardsFile, serializeAuthGuards(getFileImportRelativePath(authGuardsFile, functionTypesFile, packageMappings), `import type { RequiredSingletonServices } from '${getFileImportRelativePath(authGuardsFile, servicesFile, packageMappings)}'`, config.addonName));
|
|
40
40
|
const addonRefs = serializeAddonRefs({
|
|
41
41
|
addonHttp: visitState.exportedContracts.addonHttp,
|
|
42
42
|
addonChannel: visitState.exportedContracts.addonChannel,
|
|
@@ -60,8 +60,18 @@ ${userSessionTypeName !== 'Session' ? `export type Session = ${userSessionTypeNa
|
|
|
60
60
|
* services **non-optional** at every call site. A service is optional only when
|
|
61
61
|
* nothing destructures it — in which case it is never created either. This is
|
|
62
62
|
* why an \`if (!service)\` guard inside a function body is always dead code.
|
|
63
|
+
*
|
|
64
|
+
* Only the wire-services half lives here. The singleton half is declared by the
|
|
65
|
+
* auth and middleware leaves that use it, because whether a name earns its
|
|
66
|
+
* export is measured rather than chosen: emit declarations for a project and
|
|
67
|
+
* \`WiredServices\` is named by 147 of its \`.d.ts\` files, while the singleton
|
|
68
|
+
* intersection is named by none outside the leaves that declare it. Export the
|
|
69
|
+
* latter and it is a compatibility promise nothing asked for; unexport
|
|
70
|
+
* \`WiredServices\` and every wired module inlines the intersection instead,
|
|
71
|
+
* which asks it to name each member service through a specifier it does not
|
|
72
|
+
* have — 3308 TS2883s. \`--noEmit\` cannot surface any of that, so re-check with
|
|
73
|
+
* \`tsc --declaration --emitDeclarationOnly\` before moving either one.
|
|
63
74
|
*/
|
|
64
|
-
export type WiredSingletonServices = RequiredSingletonServices & SingletonServices
|
|
65
75
|
export type WiredServices = SecretlessServices<RequiredSingletonServices & Services>
|
|
66
76
|
|
|
67
77
|
/**
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* here rather than alongside the function types that consume it; those types
|
|
7
7
|
* import it back, which is a type-only edge and carries no runtime cycle.
|
|
8
8
|
*/
|
|
9
|
-
export declare const serializeMiddlewareTypes: (functionTypesImportPath: string, packageName?: string) => string;
|
|
9
|
+
export declare const serializeMiddlewareTypes: (functionTypesImportPath: string, requiredServicesTypeImport: string, packageName?: string) => string;
|