@pikku/cli 0.12.137 → 0.12.143
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 +153 -0
- package/console-app/assets/{abnfDiagram-N423BO3Z-W1UI4BWy.js → abnfDiagram-N423BO3Z-CG60mMUd.js} +1 -1
- package/console-app/assets/architecture-TIHT7OUA-DSzfLiV3.js +1 -0
- package/console-app/assets/{architectureDiagram-T3A2C74G-Dgnhu9J8.js → architectureDiagram-T3A2C74G-Ch6qWsLf.js} +1 -1
- package/console-app/assets/{blockDiagram-VBNYF7ZC-Da-H9pFU.js → blockDiagram-VBNYF7ZC-yRgqjgqW.js} +1 -1
- package/console-app/assets/{c4Diagram-5PPSVZJV-CPQ006DM.js → c4Diagram-5PPSVZJV-NvawOgnU.js} +1 -1
- package/console-app/assets/channel-DYUdcfEK.js +1 -0
- package/console-app/assets/{chunk-2GRJ4B5K-B3QE8g_6.js → chunk-2GRJ4B5K-BJ9-Roz7.js} +1 -1
- package/console-app/assets/{chunk-4I5QYGJK-D04DssN0.js → chunk-4I5QYGJK-DZwmcj48.js} +1 -1
- package/console-app/assets/{chunk-5RXB4S5H-CXe_vAKZ.js → chunk-5RXB4S5H-BTBwIEIt.js} +1 -1
- package/console-app/assets/{chunk-6Q2QTUOP-DhpMC5UR.js → chunk-6Q2QTUOP-C55aqlA-.js} +1 -1
- package/console-app/assets/{chunk-7Z6QIM7H-CtoQQGfm.js → chunk-7Z6QIM7H-DRmYZ-SZ.js} +1 -1
- package/console-app/assets/{chunk-GF5L2VYU-BovriS0p.js → chunk-GF5L2VYU-InZeM4Hr.js} +1 -1
- package/console-app/assets/{chunk-I66GZJ75-Goasace2.js → chunk-I66GZJ75-BNvijc65.js} +1 -1
- package/console-app/assets/{chunk-JQJVKLGR-Dy3HStoh.js → chunk-JQJVKLGR-CIMXqmif.js} +1 -1
- package/console-app/assets/{chunk-KBJHAD2P-Cm5EwbeQ.js → chunk-KBJHAD2P-C9h3FBoE.js} +1 -1
- package/console-app/assets/{chunk-NSK5VX7P-DZ-VVQUA.js → chunk-NSK5VX7P-lz8xBTRo.js} +1 -1
- package/console-app/assets/{chunk-QR6OTTB3-W5GRG-wW.js → chunk-QR6OTTB3-CjOfjLMq.js} +1 -1
- package/console-app/assets/{chunk-RYQCIY6F-_xvZ8Hx8.js → chunk-RYQCIY6F-CV3667Qm.js} +1 -1
- package/console-app/assets/{chunk-UBXNYLIW-C0L1Tpxq.js → chunk-UBXNYLIW-CBN7usxw.js} +1 -1
- package/console-app/assets/{chunk-W5SLKNZC-DAyLbBQq.js → chunk-W5SLKNZC-5TkpffRm.js} +1 -1
- package/console-app/assets/{chunk-WRU74C26-BrL4inwu.js → chunk-WRU74C26-GBek0Nby.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-B3U_w_pW.js +1 -0
- package/console-app/assets/classDiagram-JCYQIIEL-Mg8_8GSE.js +1 -0
- package/console-app/assets/classDiagram-v2-OCEON4UE-Mg8_8GSE.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-DxHzzMQL.js → cose-bilkent-JH36ORCC-BkGyb7Kn.js} +1 -1
- package/console-app/assets/{cynefin-VYW2F7L2-7ytt-CDO.js → cynefin-VYW2F7L2-qMmeyMja.js} +1 -1
- package/console-app/assets/{cynefinDiagram-MW4NZA55-Cq-zIV7s.js → cynefinDiagram-MW4NZA55-7MuIYiO4.js} +1 -1
- package/console-app/assets/{dagre-Dl-9JF5i.js → dagre-BbESpUs5.js} +1 -1
- package/console-app/assets/{dagre-VZM6K2ZE-DLlanPb9.js → dagre-VZM6K2ZE-I6YsMazW.js} +1 -1
- package/console-app/assets/{diagram-7IWD3JNH-NTCRs_uw.js → diagram-7IWD3JNH-CJPB2T6d.js} +1 -1
- package/console-app/assets/{diagram-B4RE2ZJO-Dwf7hoRU.js → diagram-B4RE2ZJO-CmFGMFPx.js} +1 -1
- package/console-app/assets/{diagram-LBJQPF4R-2h_a7jsr.js → diagram-LBJQPF4R-BMzRMe8g.js} +1 -1
- package/console-app/assets/{diagram-Q27KOJAE-DuOfl1WJ.js → diagram-Q27KOJAE-CeJb7xQ2.js} +1 -1
- package/console-app/assets/{diagram-UB23O5K3-Blp2hikL.js → diagram-UB23O5K3-BQkhJgYU.js} +1 -1
- package/console-app/assets/{ebnfDiagram-BXEA7PRR-BwdeYz2Z.js → ebnfDiagram-BXEA7PRR-C1F_8089.js} +1 -1
- package/console-app/assets/{erDiagram-JOGREHBK-DY_x1XSg.js → erDiagram-JOGREHBK-DRwpdW4v.js} +1 -1
- package/console-app/assets/eventmodeling-45OFAUF4-C5L7A6YY.js +1 -0
- package/console-app/assets/flowDiagram-UKHOOZJN-D6GmsM3x.js +1 -0
- package/console-app/assets/{ganttDiagram-PKOTCBZU-DxiIwMWB.js → ganttDiagram-PKOTCBZU-CfsGz3Lj.js} +1 -1
- package/console-app/assets/{gitGraph-TEB2WS4Q-C3DsIpZV.js → gitGraph-TEB2WS4Q-BBt9AGD3.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-DS77QQ5N-C2pPy08m.js → gitGraphDiagram-DS77QQ5N-y5WPOR-G.js} +1 -1
- package/console-app/assets/{index-D6aBqNnO.js → index-BmvyL35Z.js} +150 -150
- package/console-app/assets/{info-DKCQHKI2-FJuVYZ8D.js → info-DKCQHKI2-mYDlDDyA.js} +1 -1
- package/console-app/assets/{infoDiagram-6WML65LV-Bih5T82B.js → infoDiagram-6WML65LV-uOP7AjEu.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-WSZJBQD7-jOkuIgMl.js → ishikawaDiagram-WSZJBQD7-BUMKV94t.js} +1 -1
- package/console-app/assets/{journeyDiagram-NVQOT4AX-CZ9yVscx.js → journeyDiagram-NVQOT4AX-C8_km86P.js} +1 -1
- package/console-app/assets/{kanban-definition-27J2QSJJ-Dpmgfv5c.js → kanban-definition-27J2QSJJ-Ce5oUBPR.js} +1 -1
- package/console-app/assets/{line-DjmQl1gv.js → line-D-6c8Gxs.js} +1 -1
- package/console-app/assets/{linear-B8fAzric.js → linear-CyrGkJOO.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-BxoecV24.js → mermaid-parser.core-CYuFKArA.js} +3 -3
- package/console-app/assets/{mermaid.core-D2Ux-Rs7.js → mermaid.core-CXQhu3yO.js} +4 -4
- package/console-app/assets/{mindmap-definition-FAOFIHXS-5xpWfvPY.js → mindmap-definition-FAOFIHXS-CTMHna5d.js} +1 -1
- package/console-app/assets/{packet-7NZHBO7P-Bq9JPqWg.js → packet-7NZHBO7P-Bu7Wxek6.js} +1 -1
- package/console-app/assets/{pegDiagram-VL7TDLO6-BKWLK1GI.js → pegDiagram-VL7TDLO6-CQOikBgW.js} +1 -1
- package/console-app/assets/{pie-RZYD4A2V-CsGG-f-c.js → pie-RZYD4A2V-Co7qIvyZ.js} +1 -1
- package/console-app/assets/{pieDiagram-7S7Q4E2Y-BRy6lUc2.js → pieDiagram-7S7Q4E2Y-Dh6jYgnj.js} +1 -1
- package/console-app/assets/{quadrantDiagram-CIZ2JOQS-OcYHZLLg.js → quadrantDiagram-CIZ2JOQS-Boongjy-.js} +1 -1
- package/console-app/assets/{radar-I7S5WNFK-8MO05jdC.js → radar-I7S5WNFK-CSJyAKYA.js} +1 -1
- package/console-app/assets/{railroad-3IZDKUUU-CLs1yR0q.js → railroad-3IZDKUUU-DklknXem.js} +1 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-D-2EAJOD.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-C5XxxCx7.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-D8fXoMuX.js +1 -0
- package/console-app/assets/{railroadDiagram-AXF67PYL-DjpHDwhw.js → railroadDiagram-AXF67PYL-DEapZRM_.js} +1 -1
- package/console-app/assets/{requirementDiagram-LRYGKXZP-CyKaqOMR.js → requirementDiagram-LRYGKXZP-CqFLtnyL.js} +1 -1
- package/console-app/assets/{sankeyDiagram-W5VNT64P-0WoWlmdY.js → sankeyDiagram-W5VNT64P-CNu-G1MH.js} +1 -1
- package/console-app/assets/{sequenceDiagram-SI44F4Z6-kd31YoP4.js → sequenceDiagram-SI44F4Z6-CoEKUR3G.js} +1 -1
- package/console-app/assets/{src-CGPyCqg2.js → src-C1UIZ0TF.js} +1 -1
- package/console-app/assets/{stateDiagram-OKZ733FA-Cwy-Xwqp.js → stateDiagram-OKZ733FA-CJka40EH.js} +1 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-Bfuo66an.js +1 -0
- package/console-app/assets/{swimlanes-SLNWSIFB-Cq0Pq-Qq.js → swimlanes-SLNWSIFB-Dv3MGmvW.js} +1 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-CyQmsXKP.js +8 -0
- package/console-app/assets/{timeline-definition-Z64GVDOM-CgFH2I_j.js → timeline-definition-Z64GVDOM-CO8etJHi.js} +1 -1
- package/console-app/assets/{treeView-QDETBFTQ-CmeHYUxi.js → treeView-QDETBFTQ-BjLcvY-V.js} +1 -1
- package/console-app/assets/{treemap-6X3UGDF4-B6JWxyQe.js → treemap-6X3UGDF4-xC9XqGfS.js} +1 -1
- package/console-app/assets/{vennDiagram-T6HMQDX7-DdGYpKcz.js → vennDiagram-T6HMQDX7-CJGsYvlQ.js} +1 -1
- package/console-app/assets/{wardley-OPB4EBWU-BVF8AOCQ.js → wardley-OPB4EBWU-DkMc876g.js} +1 -1
- package/console-app/assets/{wardleyDiagram-T6FBY63Y-BUFon1WP.js → wardleyDiagram-T6FBY63Y-CTe7zAVZ.js} +1 -1
- package/console-app/assets/{xychartDiagram-ELKLHX3M-Bu-WJdeF.js → xychartDiagram-ELKLHX3M-CABg-MLE.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 +1 -1
- 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 +11 -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-contracts-meta.gen.json +11 -0
- 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 +24 -0
- 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 +1 -1
- 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 +77 -89
- package/dist/.pikku/function/pikku-functions.gen.js +3 -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 +1 -1
- 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 +1 -1
- 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/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -3
- 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 +7 -5
- package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/KnowledgeReconcileInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/KnowledgeReconcileOutput.schema.json +1 -0
- 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/meta/allWorkflow.gen.json +8 -2
- 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/cli.wiring.js +11 -1
- package/dist/src/deploy/analyzer/analyzer.js +29 -0
- package/dist/src/deploy/build-pipeline.js +2 -0
- package/dist/src/deploy/bundler/bun-bundler.js +5 -2
- package/dist/src/deploy/bundler/bundler.interface.d.ts +9 -1
- package/dist/src/deploy/bundler/bundler.js +1 -0
- package/dist/src/deploy/bundler/node-bundler.js +12 -2
- package/dist/src/deploy/bundler/service-module-map.js +2 -2
- package/dist/src/fabric/fabric-commands.d.ts +18 -9
- package/dist/src/fabric/fabric-commands.js +11 -0
- package/dist/src/fabric/functions/deploy.function.d.ts +5 -5
- package/dist/src/fabric/functions/link.function.d.ts +12 -0
- package/dist/src/fabric/functions/link.function.js +95 -6
- package/dist/src/fabric/functions/llm-key.function.d.ts +4 -4
- package/dist/src/fabric/functions/smoke.function.d.ts +4 -4
- package/dist/src/fabric/lib/git.d.ts +27 -0
- package/dist/src/fabric/lib/git.js +70 -2
- package/dist/src/functions/commands/db-export.js +4 -9
- package/dist/src/functions/commands/dev.js +12 -18
- package/dist/src/functions/commands/enable.d.ts +1 -0
- package/dist/src/functions/commands/enable.js +3 -0
- package/dist/src/functions/commands/knowledge-reconcile.d.ts +45 -0
- package/dist/src/functions/commands/knowledge-reconcile.js +11 -0
- package/dist/src/functions/commands/serve.js +12 -18
- package/dist/src/functions/db/local-db.d.ts +12 -2
- package/dist/src/functions/db/local-db.js +86 -14
- package/dist/src/functions/knowledge/render.d.ts +12 -1
- package/dist/src/functions/knowledge/render.js +48 -0
- package/dist/src/functions/knowledge/schemas.d.ts +23 -0
- package/dist/src/functions/knowledge/schemas.js +3 -1
- package/dist/src/functions/wirings/agent/pikku-command-agent.js +11 -14
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +10 -13
- package/dist/src/functions/wirings/cli/pikku-command-cli.js +10 -13
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +7 -15
- package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +2 -8
- package/dist/src/functions/wirings/functions/pikku-command-functions.js +21 -18
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.js +11 -10
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +10 -13
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +11 -17
- package/dist/src/functions/wirings/personas/serialize-personas-types.js +2 -2
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +11 -14
- package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.d.ts +1 -0
- package/dist/src/functions/wirings/remote-jobs/pikku-command-remote-jobs.js +31 -0
- package/dist/src/functions/wirings/remote-jobs/serialize-remote-jobs.d.ts +16 -0
- package/dist/src/functions/wirings/remote-jobs/serialize-remote-jobs.js +78 -0
- package/dist/src/functions/wirings/roles/serialize-roles-types.js +2 -2
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.js +11 -12
- package/dist/src/functions/wirings/scopes/serialize-scopes-client.js +2 -2
- package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +5 -3
- package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +4 -10
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.js +11 -11
- package/dist/src/functions/wirings/variables/serialize-variables-types.js +2 -8
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +7 -8
- package/dist/src/functions/workflows/all.workflow.js +8 -0
- package/dist/src/services.js +13 -0
- package/dist/src/utils/pikku-cli-config.js +4 -0
- package/dist/src/utils/remote-jobs-schemas-file.d.ts +6 -0
- package/dist/src/utils/remote-jobs-schemas-file.js +9 -0
- package/dist/src/utils/remove-legacy-scaffold-file.js +3 -0
- package/dist/src/utils/strip-verbose-meta.d.ts +9 -10
- package/dist/src/utils/strip-verbose-meta.js +15 -19
- package/dist/src/utils/ts-literal.d.ts +7 -0
- package/dist/src/utils/ts-literal.js +7 -0
- package/dist/src/utils/write-wiring-meta.d.ts +43 -0
- package/dist/src/utils/write-wiring-meta.js +45 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/surface.json +15 -15
- package/console-app/assets/architecture-TIHT7OUA-ChuyZvLt.js +0 -1
- package/console-app/assets/channel-Bk5Nkkn2.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-CCdCi2uV.js +0 -1
- package/console-app/assets/classDiagram-JCYQIIEL-Dgekxp3j.js +0 -1
- package/console-app/assets/classDiagram-v2-OCEON4UE-Dgekxp3j.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-2ImzjrgM.js +0 -1
- package/console-app/assets/flowDiagram-UKHOOZJN-DmrgHe66.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-CA9-7Fw1.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-BhkwTTAW.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-BEaB8UlJ.js +0 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-DExEOOCw.js +0 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-B0RUxlCH.js +0 -8
- package/dist/.pikku/schemas/schemas/PikkuQueueOutput.schema.json +0 -1
- package/dist/src/fabric/lib/not-implemented.d.ts +0 -5
- package/dist/src/fabric/lib/not-implemented.js +0 -8
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +0 -1
- package/dist/src/functions/wirings/channels/pikku-channels.js +0 -38
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +0 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.js +0 -30
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +0 -1
- package/dist/src/functions/wirings/queue/pikku-queue.js +0 -31
- package/dist/src/utils/pikku-files-and-methods.d.ts +0 -20
- package/dist/src/utils/pikku-files-and-methods.js +0 -25
- /package/dist/.pikku/schemas/schemas/{PikkuHTTPOutput.schema.json → PikkuRemoteJobsOutput.schema.json} +0 -0
|
@@ -3,7 +3,7 @@ import { serializeFileImports } from '../../../utils/file-imports-serializer.js'
|
|
|
3
3
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
6
|
-
import {
|
|
6
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
7
7
|
export const pikkuCommandChannels = pikkuSessionlessFunc({
|
|
8
8
|
func: async ({ logger, config, getInspectorState }) => {
|
|
9
9
|
const visitState = await getInspectorState();
|
|
@@ -21,12 +21,6 @@ export const pikkuCommandChannels = pikkuSessionlessFunc({
|
|
|
21
21
|
// (channels.files is empty). Skipping either leaves the bootstrap importing
|
|
22
22
|
// a file that was never generated and the per-unit deploy bundle fails.
|
|
23
23
|
await writeFileInDir(logger, channelsWiringFile, serializeFileImports('addChannel', channelsWiringFile, channels.files, packageMappings));
|
|
24
|
-
const minimalMeta = stripVerboseFields(channels.meta);
|
|
25
|
-
await writeFileInDir(logger, channelsWiringMetaJsonFile, JSON.stringify(minimalMeta, null, 2));
|
|
26
|
-
if (hasVerboseFields(channels.meta)) {
|
|
27
|
-
const verbosePath = channelsWiringMetaJsonFile.replace(/\.gen\.json$/, '-verbose.gen.json');
|
|
28
|
-
await writeFileInDir(logger, verbosePath, JSON.stringify(channels.meta, null, 2));
|
|
29
|
-
}
|
|
30
24
|
await writeFileInDir(logger, channelContractsMetaJsonFile, JSON.stringify(exportedContracts.channel, null, 2));
|
|
31
25
|
if (hasChannelContracts) {
|
|
32
26
|
const contractsJsonImportPath = getFileImportRelativePath(channelContractsMetaFile, channelContractsMetaJsonFile, packageMappings);
|
|
@@ -36,12 +30,15 @@ export const pikkuCommandChannels = pikkuSessionlessFunc({
|
|
|
36
30
|
: `import contractsMeta from '${contractsJsonImportPath}'`;
|
|
37
31
|
await writeFileInDir(logger, channelContractsMetaFile, `${contractsImportStatement}\nexport default contractsMeta`);
|
|
38
32
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
:
|
|
44
|
-
|
|
33
|
+
await writeWiringMeta({
|
|
34
|
+
logger,
|
|
35
|
+
meta: channels.meta,
|
|
36
|
+
metaJsonFile: channelsWiringMetaJsonFile,
|
|
37
|
+
metaFile: channelsWiringMetaFile,
|
|
38
|
+
packageMappings,
|
|
39
|
+
supportsImportAttributes: schema?.supportsImportAttributes ?? false,
|
|
40
|
+
serializeMetaTS: ({ importStatement }) => `import { pikkuState } from '@pikku/core/state'\nimport type { ChannelsMeta } from '@pikku/core/channel'\n${importStatement}\npikkuState(null, 'channel', 'meta', metaData as ChannelsMeta)`,
|
|
41
|
+
});
|
|
45
42
|
return true;
|
|
46
43
|
},
|
|
47
44
|
middleware: [
|
|
@@ -3,7 +3,7 @@ import { serializeFileImports } from '../../../utils/file-imports-serializer.js'
|
|
|
3
3
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
6
|
-
import {
|
|
6
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
7
7
|
export const pikkuCLI = pikkuSessionlessFunc({
|
|
8
8
|
func: async ({ logger, config, getInspectorState }) => {
|
|
9
9
|
const visitState = await getInspectorState();
|
|
@@ -21,12 +21,6 @@ export const pikkuCLI = pikkuSessionlessFunc({
|
|
|
21
21
|
// Skipping either leaves the bootstrap importing a file that was never
|
|
22
22
|
// generated and the per-unit deploy bundle fails.
|
|
23
23
|
await writeFileInDir(logger, cliWiringsFile, serializeFileImports('wireCLI', cliWiringsFile, cli.files, packageMappings));
|
|
24
|
-
const minimalMeta = stripVerboseFields(cli.meta);
|
|
25
|
-
await writeFileInDir(logger, cliWiringMetaJsonFile, JSON.stringify(minimalMeta, null, 2));
|
|
26
|
-
if (hasVerboseFields(cli.meta)) {
|
|
27
|
-
const verbosePath = cliWiringMetaJsonFile.replace(/\.gen\.json$/, '-verbose.gen.json');
|
|
28
|
-
await writeFileInDir(logger, verbosePath, JSON.stringify(cli.meta, null, 2));
|
|
29
|
-
}
|
|
30
24
|
await writeFileInDir(logger, cliContractsMetaJsonFile, JSON.stringify(exportedContracts.cli, null, 2));
|
|
31
25
|
if (hasCLIContracts) {
|
|
32
26
|
const contractsJsonImportPath = getFileImportRelativePath(cliContractsMetaFile, cliContractsMetaJsonFile, packageMappings);
|
|
@@ -36,12 +30,15 @@ export const pikkuCLI = pikkuSessionlessFunc({
|
|
|
36
30
|
: `import contractsMeta from '${contractsJsonImportPath}'`;
|
|
37
31
|
await writeFileInDir(logger, cliContractsMetaFile, `${contractsImportStatement}\nexport default contractsMeta`);
|
|
38
32
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
:
|
|
44
|
-
|
|
33
|
+
await writeWiringMeta({
|
|
34
|
+
logger,
|
|
35
|
+
meta: cli.meta,
|
|
36
|
+
metaJsonFile: cliWiringMetaJsonFile,
|
|
37
|
+
metaFile: cliWiringMetaFile,
|
|
38
|
+
packageMappings,
|
|
39
|
+
supportsImportAttributes: schema?.supportsImportAttributes ?? false,
|
|
40
|
+
serializeMetaTS: ({ importStatement }) => `import { pikkuState } from '@pikku/core/state'\nimport { CLIMeta } from '@pikku/core/cli'\n${importStatement}\npikkuState(null, 'cli', 'meta', metaData as CLIMeta)`,
|
|
41
|
+
});
|
|
45
42
|
return true;
|
|
46
43
|
},
|
|
47
44
|
middleware: [
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { pikkuSessionlessFunc } from '#pikku/function';
|
|
2
2
|
import { ErrorCode } from '@pikku/inspector';
|
|
3
|
-
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
3
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
4
|
import { readFile } from 'fs/promises';
|
|
6
5
|
import { join, isAbsolute } from 'path';
|
|
7
|
-
import {
|
|
6
|
+
import { writeMetaSidecar } from '../../../utils/write-wiring-meta.js';
|
|
8
7
|
import { validateAndBuildSecretDefinitionsMeta } from '@pikku/core/secret';
|
|
9
8
|
const loadIcon = async (iconPath, rootDir, logger) => {
|
|
10
9
|
if (!iconPath)
|
|
@@ -73,19 +72,12 @@ export const pikkuNodesMeta = pikkuSessionlessFunc({
|
|
|
73
72
|
metaData.requiredParentServices = state.addonRequiredParentServices;
|
|
74
73
|
}
|
|
75
74
|
if (addonMetaJsonFile && (config.scaffold?.console || config.addon)) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (verbosePath === addonMetaJsonFile) {
|
|
83
|
-
logger.warn(`Cannot derive verbose path from ${addonMetaJsonFile}, skipping verbose metadata`);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
await writeFileInDir(logger, verbosePath, JSON.stringify(metaData, null, 2), { ignoreModifyComment: true });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
75
|
+
await writeMetaSidecar({
|
|
76
|
+
logger,
|
|
77
|
+
meta: metaData,
|
|
78
|
+
metaJsonFile: addonMetaJsonFile,
|
|
79
|
+
ignoreModifyComment: true,
|
|
80
|
+
});
|
|
89
81
|
}
|
|
90
82
|
return true;
|
|
91
83
|
},
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { validateAndBuildCredentialDefinitionsMeta } from '@pikku/core/credential';
|
|
2
2
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
3
|
-
|
|
4
|
-
* A display name is the human-facing label a developer wrote, so an apostrophe
|
|
5
|
-
* in it is ordinary. `JSON.stringify` emits a valid, escaped TypeScript string
|
|
6
|
-
* literal; interpolating the raw text into a quoted one terminates the string
|
|
7
|
-
* and the generated file stops parsing.
|
|
8
|
-
*/
|
|
9
|
-
const literal = (value) => JSON.stringify(value);
|
|
3
|
+
import { tsLiteral } from '../../../utils/ts-literal.js';
|
|
10
4
|
export const serializeCredentialsTypes = ({ definitions, schemaLookup, credentialsFile, packageMappings, }) => {
|
|
11
5
|
const credentials = validateAndBuildCredentialDefinitionsMeta(definitions, schemaLookup);
|
|
12
6
|
const credentialEntries = Object.entries(credentials);
|
|
@@ -29,7 +23,7 @@ export const serializeCredentialsTypes = ({ definitions, schemaLookup, credentia
|
|
|
29
23
|
}
|
|
30
24
|
const metaParts = [
|
|
31
25
|
`name: '${name}'`,
|
|
32
|
-
`displayName: ${
|
|
26
|
+
`displayName: ${tsLiteral(meta.displayName)}`,
|
|
33
27
|
`type: '${meta.type}'`,
|
|
34
28
|
];
|
|
35
29
|
if (meta.oauth2) {
|
|
@@ -3,31 +3,32 @@ import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
|
3
3
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
4
|
import { serializeFunctionImports } from './serialize-function-imports.js';
|
|
5
5
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
6
|
-
import { stripVerboseFields,
|
|
6
|
+
import { stripVerboseFields, reattachFunctionServices, reattachAgentToolDescriptions, } from '../../../utils/strip-verbose-meta.js';
|
|
7
|
+
import { writeMetaSidecar, writeWiringMeta, } from '../../../utils/write-wiring-meta.js';
|
|
7
8
|
import { partitionScenarioFunctions, partitionScenarioFunctionsMeta, } from '../scenarios/scenario-partition.js';
|
|
8
9
|
import { serializeScenarioFunctionMeta } from '../scenarios/serialize-scenario-meta.js';
|
|
9
10
|
export const pikkuFunctions = pikkuSessionlessFunc({
|
|
10
11
|
func: async ({ logger, config, getInspectorState }) => {
|
|
11
|
-
const { functions, rpc } = await getInspectorState();
|
|
12
|
+
const { functions, rpc, agents } = await getInspectorState();
|
|
12
13
|
const { functionsMetaFile, functionsMetaJsonFile, functionsFile, scenarioStepsFile, scenarioStepsMetaFile, scenarioStepsMetaJsonFile, packageMappings, schema, } = config;
|
|
13
14
|
const { app: appFunctionsMeta, scenario: scenarioFunctionsMeta } = partitionScenarioFunctionsMeta(functions.meta);
|
|
14
15
|
let minimalMeta = stripVerboseFields(appFunctionsMeta);
|
|
15
16
|
if (config.addonName) {
|
|
16
17
|
minimalMeta = reattachFunctionServices(minimalMeta, appFunctionsMeta);
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
// Write verbose JSON only if it has additional fields
|
|
20
|
-
if (hasVerboseFields(appFunctionsMeta)) {
|
|
21
|
-
const verbosePath = functionsMetaJsonFile.replace(/\.gen\.json$/, '-verbose.gen.json');
|
|
22
|
-
await writeFileInDir(logger, verbosePath, JSON.stringify(appFunctionsMeta, null, 2));
|
|
23
|
-
}
|
|
24
|
-
const jsonImportPath = getFileImportRelativePath(functionsMetaFile, functionsMetaJsonFile, packageMappings);
|
|
25
|
-
const supportsImportAttributes = schema?.supportsImportAttributes ?? false;
|
|
26
|
-
const importStatement = supportsImportAttributes
|
|
27
|
-
? `import metaData from '${jsonImportPath}' with { type: 'json' }`
|
|
28
|
-
: `import metaData from '${jsonImportPath}'`;
|
|
19
|
+
minimalMeta = reattachAgentToolDescriptions(minimalMeta, appFunctionsMeta, new Set(Object.values(agents.agentsMeta).flatMap((agent) => agent.tools ?? [])));
|
|
29
20
|
const packageName = config.addonName ? `'${config.addonName}'` : 'null';
|
|
30
|
-
|
|
21
|
+
const supportsImportAttributes = schema?.supportsImportAttributes ?? false;
|
|
22
|
+
await writeWiringMeta({
|
|
23
|
+
logger,
|
|
24
|
+
meta: appFunctionsMeta,
|
|
25
|
+
minimalMeta,
|
|
26
|
+
metaJsonFile: functionsMetaJsonFile,
|
|
27
|
+
metaFile: functionsMetaFile,
|
|
28
|
+
packageMappings,
|
|
29
|
+
supportsImportAttributes,
|
|
30
|
+
serializeMetaTS: ({ importStatement }) => `import { pikkuState } from '@pikku/core/state'\nimport type { FunctionsMeta } from '@pikku/core/services'\n${importStatement}\npikkuState(${packageName}, 'function', 'meta', metaData as FunctionsMeta)`,
|
|
31
|
+
});
|
|
31
32
|
// For addon packages, register ALL functions (they'll be invoked by consumers)
|
|
32
33
|
// For main packages, only register functions that are invoked via internal RPCs
|
|
33
34
|
const isAddon = !!config.addonName;
|
|
@@ -43,13 +44,15 @@ export const pikkuFunctions = pikkuSessionlessFunc({
|
|
|
43
44
|
// Always written, even when empty: a project that deletes its last scenario
|
|
44
45
|
// must stop registering the one it had, and the scenario bootstrap imports
|
|
45
46
|
// these unconditionally.
|
|
46
|
-
|
|
47
|
+
//
|
|
47
48
|
// The bootstrap imports the stripped copy; the verbose one is read off disk
|
|
48
49
|
// by whatever documents a scenario — the console needs `sourceFile` and
|
|
49
50
|
// `exportedName` to show the code a step runs.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
await writeMetaSidecar({
|
|
52
|
+
logger,
|
|
53
|
+
meta: scenarioFunctionsMeta,
|
|
54
|
+
metaJsonFile: scenarioStepsMetaJsonFile,
|
|
55
|
+
});
|
|
53
56
|
await writeFileInDir(logger, scenarioStepsMetaFile, serializeScenarioFunctionMeta(getFileImportRelativePath(scenarioStepsMetaFile, scenarioStepsMetaJsonFile, packageMappings), getFileImportRelativePath(scenarioStepsMetaFile, functionsMetaFile, packageMappings), supportsImportAttributes, config.addonName));
|
|
54
57
|
await writeFileInDir(logger, scenarioStepsFile, scenarioFiles.size === 0
|
|
55
58
|
? 'export {}'
|
|
@@ -2,8 +2,7 @@ import { pikkuSessionlessFunc } from '#pikku/function';
|
|
|
2
2
|
import { serializeFileImports } from '../../../utils/file-imports-serializer.js';
|
|
3
3
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
-
import {
|
|
6
|
-
import { stripVerboseFields, hasVerboseFields, } from '../../../utils/strip-verbose-meta.js';
|
|
5
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
7
6
|
import { serializeGatewayMeta, serializeGatewayMetaTS, } from './serialize-gateway-meta.js';
|
|
8
7
|
export const pikkuGateway = pikkuSessionlessFunc({
|
|
9
8
|
func: async ({ logger, config, getInspectorState }) => {
|
|
@@ -14,14 +13,16 @@ export const pikkuGateway = pikkuSessionlessFunc({
|
|
|
14
13
|
return undefined;
|
|
15
14
|
}
|
|
16
15
|
const fullMeta = serializeGatewayMeta(gateways.meta);
|
|
17
|
-
const
|
|
18
|
-
await
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
const supportsImportAttributes = schema?.supportsImportAttributes ?? false;
|
|
17
|
+
await writeWiringMeta({
|
|
18
|
+
logger,
|
|
19
|
+
meta: fullMeta,
|
|
20
|
+
metaJsonFile: gatewaysWiringMetaJsonFile,
|
|
21
|
+
metaFile: gatewaysWiringMetaFile,
|
|
22
|
+
packageMappings,
|
|
23
|
+
supportsImportAttributes,
|
|
24
|
+
serializeMetaTS: ({ jsonImportPath }) => serializeGatewayMetaTS(jsonImportPath, supportsImportAttributes),
|
|
25
|
+
});
|
|
25
26
|
await writeFileInDir(logger, gatewaysWiringFile, serializeFileImports('wireGateway', gatewaysWiringFile, gateways.files, packageMappings));
|
|
26
27
|
return true;
|
|
27
28
|
},
|
|
@@ -3,7 +3,7 @@ import { serializeFileImports } from '../../../utils/file-imports-serializer.js'
|
|
|
3
3
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
6
|
-
import {
|
|
6
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
7
7
|
export const pikkuCommandHTTP = pikkuSessionlessFunc({
|
|
8
8
|
func: async ({ logger, config, getInspectorState }) => {
|
|
9
9
|
const visitState = await getInspectorState();
|
|
@@ -22,12 +22,6 @@ export const pikkuCommandHTTP = pikkuSessionlessFunc({
|
|
|
22
22
|
// bootstrap importing a file that was never generated and the per-unit
|
|
23
23
|
// deploy bundle fails to resolve it.
|
|
24
24
|
await writeFileInDir(logger, httpWiringsFile, serializeFileImports('wireHTTP', httpWiringsFile, http.files, packageMappings));
|
|
25
|
-
const minimalMeta = stripVerboseFields(http.meta);
|
|
26
|
-
await writeFileInDir(logger, httpWiringMetaJsonFile, JSON.stringify(minimalMeta, null, 2));
|
|
27
|
-
if (hasVerboseFields(http.meta)) {
|
|
28
|
-
const verbosePath = httpWiringMetaJsonFile.replace(/\.gen\.json$/, '-verbose.gen.json');
|
|
29
|
-
await writeFileInDir(logger, verbosePath, JSON.stringify(http.meta, null, 2));
|
|
30
|
-
}
|
|
31
25
|
await writeFileInDir(logger, httpContractsMetaJsonFile, JSON.stringify(exportedContracts.http, null, 2));
|
|
32
26
|
if (hasHTTPContracts) {
|
|
33
27
|
const contractsJsonImportPath = getFileImportRelativePath(httpContractsMetaFile, httpContractsMetaJsonFile, packageMappings);
|
|
@@ -37,12 +31,15 @@ export const pikkuCommandHTTP = pikkuSessionlessFunc({
|
|
|
37
31
|
: `import contractsMeta from '${contractsJsonImportPath}'`;
|
|
38
32
|
await writeFileInDir(logger, httpContractsMetaFile, `${contractsImportStatement}\nexport default contractsMeta`);
|
|
39
33
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
:
|
|
45
|
-
|
|
34
|
+
await writeWiringMeta({
|
|
35
|
+
logger,
|
|
36
|
+
meta: http.meta,
|
|
37
|
+
metaJsonFile: httpWiringMetaJsonFile,
|
|
38
|
+
metaFile: httpWiringMetaFile,
|
|
39
|
+
packageMappings,
|
|
40
|
+
supportsImportAttributes: schema?.supportsImportAttributes ?? false,
|
|
41
|
+
serializeMetaTS: ({ importStatement }) => `import { pikkuState } from '@pikku/core/state'\nimport type { HTTPWiringsMeta } from '@pikku/core/http'\n${importStatement}\npikkuState(null, 'http', 'meta', metaData as HTTPWiringsMeta)`,
|
|
42
|
+
});
|
|
46
43
|
return true;
|
|
47
44
|
},
|
|
48
45
|
middleware: [
|
|
@@ -4,8 +4,7 @@ import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { readFile } from 'fs/promises';
|
|
6
6
|
import { join } from 'path';
|
|
7
|
-
import {
|
|
8
|
-
import { stripVerboseFields, hasVerboseFields, } from '../../../utils/strip-verbose-meta.js';
|
|
7
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
9
8
|
// Helper function to generate arguments from schema
|
|
10
9
|
const generateArgumentsFromSchema = async (inputSchema, schemaDirectory, typesMap, logger) => {
|
|
11
10
|
if (!inputSchema)
|
|
@@ -74,20 +73,14 @@ export const pikkuMCP = pikkuSessionlessFunc({
|
|
|
74
73
|
toolsMeta: mcpEndpoints.toolsMeta,
|
|
75
74
|
promptsMeta: promptsMetaWithArguments,
|
|
76
75
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const jsonImportPath = getFileImportRelativePath(mcpWiringsMetaFile, config.mcpWiringsMetaJsonFile, packageMappings);
|
|
86
|
-
const supportsImportAttributes = schema?.supportsImportAttributes ?? false;
|
|
87
|
-
const importStatement = supportsImportAttributes
|
|
88
|
-
? `import metaData from '${jsonImportPath}' with { type: 'json' }`
|
|
89
|
-
: `import metaData from '${jsonImportPath}'`;
|
|
90
|
-
await writeFileInDir(logger, mcpWiringsMetaFile, `import { pikkuState } from '@pikku/core/state'
|
|
76
|
+
await writeWiringMeta({
|
|
77
|
+
logger,
|
|
78
|
+
meta: metaData,
|
|
79
|
+
metaJsonFile: config.mcpWiringsMetaJsonFile,
|
|
80
|
+
metaFile: mcpWiringsMetaFile,
|
|
81
|
+
packageMappings,
|
|
82
|
+
supportsImportAttributes: schema?.supportsImportAttributes ?? false,
|
|
83
|
+
serializeMetaTS: ({ importStatement }) => `import { pikkuState } from '@pikku/core/state'
|
|
91
84
|
import type {
|
|
92
85
|
MCPResourceMeta,
|
|
93
86
|
MCPToolMeta,
|
|
@@ -96,7 +89,8 @@ import type {
|
|
|
96
89
|
${importStatement}
|
|
97
90
|
pikkuState(null, 'mcp', 'resourcesMeta', metaData.resourcesMeta as MCPResourceMeta)
|
|
98
91
|
pikkuState(null, 'mcp', 'toolsMeta', metaData.toolsMeta as MCPToolMeta)
|
|
99
|
-
pikkuState(null, 'mcp', 'promptsMeta', metaData.promptsMeta as MCPPromptMeta)
|
|
92
|
+
pikkuState(null, 'mcp', 'promptsMeta', metaData.promptsMeta as MCPPromptMeta)`,
|
|
93
|
+
});
|
|
100
94
|
return true;
|
|
101
95
|
},
|
|
102
96
|
middleware: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { tsLiteral } from '../../../utils/ts-literal.js';
|
|
2
2
|
/**
|
|
3
3
|
* Generates the `PersonaId` union and a `definePersonas` whose `roles` are
|
|
4
4
|
* checked against the declared system roles.
|
|
@@ -12,7 +12,7 @@ export const serializePersonasTypes = ({ rolesImportPath, environmentNames, }) =
|
|
|
12
12
|
const environmentUnion = environmentNames.length > 0
|
|
13
13
|
? `\n${[...environmentNames]
|
|
14
14
|
.sort()
|
|
15
|
-
.map((name) => ` | ${
|
|
15
|
+
.map((name) => ` | ${tsLiteral(name)}`)
|
|
16
16
|
.join('\n')}`
|
|
17
17
|
: ' never';
|
|
18
18
|
return `/**
|
|
@@ -3,8 +3,7 @@ import { serializeFileImports } from '../../../utils/file-imports-serializer.js'
|
|
|
3
3
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { serializeQueueMeta, serializeQueueMetaTS, } from './serialize-queue-meta.js';
|
|
6
|
-
import {
|
|
7
|
-
import { stripVerboseFields, hasVerboseFields, } from '../../../utils/strip-verbose-meta.js';
|
|
6
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
8
7
|
export const pikkuCommandQueue = pikkuSessionlessFunc({
|
|
9
8
|
func: async ({ logger, config, getInspectorState }) => {
|
|
10
9
|
const visitState = await getInspectorState();
|
|
@@ -23,18 +22,16 @@ export const pikkuCommandQueue = pikkuSessionlessFunc({
|
|
|
23
22
|
return undefined;
|
|
24
23
|
}
|
|
25
24
|
const fullMeta = serializeQueueMeta(queueWorkers.meta);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// Write TypeScript file that imports JSON
|
|
37
|
-
await writeFileInDir(logger, queueWorkersWiringMetaFile, serializeQueueMetaTS(jsonImportPath, schema?.supportsImportAttributes ?? false));
|
|
25
|
+
const supportsImportAttributes = schema?.supportsImportAttributes ?? false;
|
|
26
|
+
await writeWiringMeta({
|
|
27
|
+
logger,
|
|
28
|
+
meta: fullMeta,
|
|
29
|
+
metaJsonFile: queueWorkersWiringMetaJsonFile,
|
|
30
|
+
metaFile: queueWorkersWiringMetaFile,
|
|
31
|
+
packageMappings,
|
|
32
|
+
supportsImportAttributes,
|
|
33
|
+
serializeMetaTS: ({ jsonImportPath }) => serializeQueueMetaTS(jsonImportPath, supportsImportAttributes),
|
|
34
|
+
});
|
|
38
35
|
await writeFileInDir(logger, queueWorkersWiringFile, serializeFileImports('addQueueWorkers', queueWorkersWiringFile, queueWorkers.files, packageMappings));
|
|
39
36
|
return true;
|
|
40
37
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuRemoteJobs: import("#pikku/function").PikkuFunctionConfig<void, boolean, "rpc" | "session", import("#pikku/function").PikkuFunctionSessionless<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices, unknown> | import("#pikku/function").PikkuFunction<void, boolean, "rpc" | "session", import("#pikku/function").WiredServices>, undefined, undefined>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku/function';
|
|
2
|
+
import { getLeafImportPath } from '../../../utils/leaf-import-path.js';
|
|
3
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
|
+
import { removeLegacyScaffoldFile } from '../../../utils/remove-legacy-scaffold-file.js';
|
|
6
|
+
import { remoteJobsSchemasFile } from '../../../utils/remote-jobs-schemas-file.js';
|
|
7
|
+
import { serializeRemoteJobs } from './serialize-remote-jobs.js';
|
|
8
|
+
import { isDeployCodegen } from '../../../utils/is-deploy-codegen.js';
|
|
9
|
+
export const pikkuRemoteJobs = pikkuSessionlessFunc({
|
|
10
|
+
func: async ({ logger, config, variables }) => {
|
|
11
|
+
if (await isDeployCodegen(variables)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const schemasFile = remoteJobsSchemasFile(config.remoteJobsFile);
|
|
15
|
+
if (config.remoteJobsFile && schemasFile) {
|
|
16
|
+
const leaf = (name) => getLeafImportPath(config.remoteJobsFile, name, config);
|
|
17
|
+
const { schemas, functions } = serializeRemoteJobs(leaf);
|
|
18
|
+
await writeFileInDir(logger, schemasFile, schemas);
|
|
19
|
+
await writeFileInDir(logger, config.remoteJobsFile, functions);
|
|
20
|
+
await removeLegacyScaffoldFile(config.remoteJobsFile);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
},
|
|
25
|
+
middleware: [
|
|
26
|
+
logCommandInfoAndTime({
|
|
27
|
+
commandStart: 'Generating Remote Jobs',
|
|
28
|
+
commandEnd: 'Generated Remote Jobs',
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
31
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface RemoteJobsGenOutput {
|
|
2
|
+
schemas: string;
|
|
3
|
+
functions: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Generate the remote-jobs inbox: the HTTP routes an external dispatcher posts
|
|
7
|
+
* to so a runtime that holds neither a queue consumer nor a clock still runs
|
|
8
|
+
* its queue workers and scheduled tasks.
|
|
9
|
+
*
|
|
10
|
+
* Ordinary `wireHTTP` routes rather than runtime-level handlers, so every
|
|
11
|
+
* runtime serves them from one implementation, and the secret check is
|
|
12
|
+
* middleware a deployment can sit its own scheme in front of. The routes are
|
|
13
|
+
* literals rather than the constants core exports, because the inspector reads
|
|
14
|
+
* them statically to build the HTTP map.
|
|
15
|
+
*/
|
|
16
|
+
export declare const serializeRemoteJobs: (leaf: (name: string) => string) => RemoteJobsGenOutput;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate the remote-jobs inbox: the HTTP routes an external dispatcher posts
|
|
3
|
+
* to so a runtime that holds neither a queue consumer nor a clock still runs
|
|
4
|
+
* its queue workers and scheduled tasks.
|
|
5
|
+
*
|
|
6
|
+
* Ordinary `wireHTTP` routes rather than runtime-level handlers, so every
|
|
7
|
+
* runtime serves them from one implementation, and the secret check is
|
|
8
|
+
* middleware a deployment can sit its own scheme in front of. The routes are
|
|
9
|
+
* literals rather than the constants core exports, because the inspector reads
|
|
10
|
+
* them statically to build the HTTP map.
|
|
11
|
+
*/
|
|
12
|
+
export const serializeRemoteJobs = (leaf) => {
|
|
13
|
+
const schemas = `/**
|
|
14
|
+
* Auto-generated remote job inbox schemas
|
|
15
|
+
* Do not edit manually - regenerate with 'npx pikku'
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod'
|
|
18
|
+
|
|
19
|
+
export const RemoteQueueJob = z.object({
|
|
20
|
+
queueName: z.string(),
|
|
21
|
+
data: z.unknown().optional(),
|
|
22
|
+
jobId: z.string().optional(),
|
|
23
|
+
traceId: z.string().optional(),
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export const RemoteScheduledJob = z.object({
|
|
27
|
+
taskName: z.string(),
|
|
28
|
+
})
|
|
29
|
+
`;
|
|
30
|
+
const functions = `/**
|
|
31
|
+
* Auto-generated remote job inbox
|
|
32
|
+
* Do not edit manually - regenerate with 'npx pikku'
|
|
33
|
+
*/
|
|
34
|
+
import { pikkuSessionlessFunc } from '${leaf('function')}'
|
|
35
|
+
import { wireHTTP } from '${leaf('http')}'
|
|
36
|
+
import {
|
|
37
|
+
pikkuRemoteQueueJobFunc,
|
|
38
|
+
pikkuRemoteScheduledJobFunc,
|
|
39
|
+
} from '@pikku/core/services'
|
|
40
|
+
import { remoteJobsSecret } from '@pikku/core/middleware'
|
|
41
|
+
import { RemoteQueueJob, RemoteScheduledJob } from './remote-jobs.schemas.gen.js'
|
|
42
|
+
|
|
43
|
+
const runRemoteQueueJob = pikkuSessionlessFunc({
|
|
44
|
+
auth: false,
|
|
45
|
+
input: RemoteQueueJob,
|
|
46
|
+
tags: ['pikku'],
|
|
47
|
+
description: 'Runs one queue worker for a job delivered by an external dispatcher.',
|
|
48
|
+
func: async ({ logger }, data) => pikkuRemoteQueueJobFunc({ logger }, data),
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const runRemoteScheduledJob = pikkuSessionlessFunc({
|
|
52
|
+
auth: false,
|
|
53
|
+
input: RemoteScheduledJob,
|
|
54
|
+
tags: ['pikku'],
|
|
55
|
+
description: 'Runs one scheduled task for a tick delivered by an external scheduler.',
|
|
56
|
+
func: async ({ logger }, data) => pikkuRemoteScheduledJobFunc({ logger }, data),
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
wireHTTP({
|
|
60
|
+
method: 'post',
|
|
61
|
+
route: '/__pikku/queue-job',
|
|
62
|
+
auth: false,
|
|
63
|
+
tags: ['pikku'],
|
|
64
|
+
func: runRemoteQueueJob,
|
|
65
|
+
middleware: [remoteJobsSecret],
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
wireHTTP({
|
|
69
|
+
method: 'post',
|
|
70
|
+
route: '/__pikku/scheduler-job',
|
|
71
|
+
auth: false,
|
|
72
|
+
tags: ['pikku'],
|
|
73
|
+
func: runRemoteScheduledJob,
|
|
74
|
+
middleware: [remoteJobsSecret],
|
|
75
|
+
})
|
|
76
|
+
`;
|
|
77
|
+
return { schemas, functions };
|
|
78
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { tsLiteral } from '../../../utils/ts-literal.js';
|
|
2
2
|
/**
|
|
3
3
|
* Generates the `SystemRoleName` union and role metadata from
|
|
4
4
|
* `defineSystemRole` declarations.
|
|
@@ -11,7 +11,7 @@ const quote = (value) => `'${value.replace(/'/g, "\\'")}'`;
|
|
|
11
11
|
export const serializeRolesTypes = ({ definitions }) => {
|
|
12
12
|
const names = [...new Set(definitions.map((d) => d.name))].sort();
|
|
13
13
|
const union = names.length > 0
|
|
14
|
-
? `\n${names.map((name) => ` | ${
|
|
14
|
+
? `\n${names.map((name) => ` | ${tsLiteral(name)}`).join('\n')}`
|
|
15
15
|
: ' never';
|
|
16
16
|
return `/**
|
|
17
17
|
* This file was generated by the @pikku/cli
|
|
@@ -3,8 +3,7 @@ import { serializeFileImports } from '../../../utils/file-imports-serializer.js'
|
|
|
3
3
|
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { serializeSchedulerMeta, serializeSchedulerMetaTS, } from './serialize-scheduler-meta.js';
|
|
6
|
-
import {
|
|
7
|
-
import { stripVerboseFields, hasVerboseFields, } from '../../../utils/strip-verbose-meta.js';
|
|
6
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
8
7
|
export const pikkuScheduler = pikkuSessionlessFunc({
|
|
9
8
|
func: async ({ logger, config, getInspectorState }) => {
|
|
10
9
|
const visitState = await getInspectorState();
|
|
@@ -15,16 +14,16 @@ export const pikkuScheduler = pikkuSessionlessFunc({
|
|
|
15
14
|
return undefined;
|
|
16
15
|
}
|
|
17
16
|
const fullMeta = serializeSchedulerMeta(scheduledTasks.meta);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
const supportsImportAttributes = schema?.supportsImportAttributes ?? false;
|
|
18
|
+
await writeWiringMeta({
|
|
19
|
+
logger,
|
|
20
|
+
meta: fullMeta,
|
|
21
|
+
metaJsonFile: schedulersWiringMetaJsonFile,
|
|
22
|
+
metaFile: schedulersWiringMetaFile,
|
|
23
|
+
packageMappings,
|
|
24
|
+
supportsImportAttributes,
|
|
25
|
+
serializeMetaTS: ({ jsonImportPath }) => serializeSchedulerMetaTS(scheduledTasks.meta, jsonImportPath, supportsImportAttributes),
|
|
26
|
+
});
|
|
28
27
|
await writeFileInDir(logger, schedulersWiringFile, serializeFileImports('addScheduledTasks', schedulersWiringFile, scheduledTasks.files, packageMappings));
|
|
29
28
|
return true;
|
|
30
29
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flattenScopeDefinitions } from '@pikku/core/scope';
|
|
2
|
-
|
|
2
|
+
import { tsLiteral } from '../../../utils/ts-literal.js';
|
|
3
3
|
/**
|
|
4
4
|
* Generates the browser-side scope client: the `ScopeId` union and a
|
|
5
5
|
* `hasScopes` that decides whether held grants satisfy a requirement.
|
|
@@ -20,7 +20,7 @@ export const serializeScopesClient = ({ definitions, }) => {
|
|
|
20
20
|
...ids.filter(hasChildren).map((id) => `${id}:*`),
|
|
21
21
|
].sort();
|
|
22
22
|
const union = requirable.length > 0
|
|
23
|
-
? `\n${requirable.map((id) => ` | ${
|
|
23
|
+
? `\n${requirable.map((id) => ` | ${tsLiteral(id)}`).join('\n')}`
|
|
24
24
|
: ' never';
|
|
25
25
|
return `/**
|
|
26
26
|
* This file was generated by the @pikku/cli
|