@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
|
@@ -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 `ScopeId` union and scope metadata from `defineScope`
|
|
5
5
|
* declarations.
|
|
@@ -19,13 +19,15 @@ export const serializeScopesTypes = ({ definitions, }) => {
|
|
|
19
19
|
...ids.filter(hasChildren).map((id) => `${id}:*`),
|
|
20
20
|
].sort();
|
|
21
21
|
const union = requirable.length > 0
|
|
22
|
-
? `\n${requirable.map((id) => ` | ${
|
|
22
|
+
? `\n${requirable.map((id) => ` | ${tsLiteral(id)}`).join('\n')}`
|
|
23
23
|
: ' never';
|
|
24
24
|
const displayNames = [...flat]
|
|
25
25
|
.sort((a, b) => a.id.localeCompare(b.id))
|
|
26
26
|
.flatMap((scope) => {
|
|
27
27
|
const displayName = definitions.find((d) => d.name === scope.id)?.displayName;
|
|
28
|
-
return displayName
|
|
28
|
+
return displayName
|
|
29
|
+
? [` ${tsLiteral(scope.id)}: ${tsLiteral(displayName)},`]
|
|
30
|
+
: [];
|
|
29
31
|
});
|
|
30
32
|
return `/**
|
|
31
33
|
* This file was generated by the @pikku/cli
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { validateAndBuildSecretDefinitionsMeta } from '@pikku/core/secret';
|
|
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 serializeSecretsTypes = ({ definitions, schemaLookup, secretsFile, packageMappings, }) => {
|
|
11
5
|
const secrets = validateAndBuildSecretDefinitionsMeta(definitions, schemaLookup);
|
|
12
6
|
const credentialEntries = Object.entries(secrets);
|
|
@@ -20,8 +14,8 @@ export const serializeSecretsTypes = ({ definitions, schemaLookup, secretsFile,
|
|
|
20
14
|
needsOAuth2Types = true;
|
|
21
15
|
mapEntries.push(` '${meta.secretId}': OAuth2AppCredential`);
|
|
22
16
|
mapEntries.push(` '${meta.oauth2.tokenSecretId}': OAuth2Token`);
|
|
23
|
-
metaEntries.push(` '${meta.secretId}': { name: '${name}', displayName: ${
|
|
24
|
-
metaEntries.push(` '${meta.oauth2.tokenSecretId}': { name: '${name}_tokens', displayName: ${
|
|
17
|
+
metaEntries.push(` '${meta.secretId}': { name: '${name}', displayName: ${tsLiteral(meta.displayName)}, oauth2: { tokenSecretId: '${meta.oauth2.tokenSecretId}' } }`);
|
|
18
|
+
metaEntries.push(` '${meta.oauth2.tokenSecretId}': { name: '${name}_tokens', displayName: ${tsLiteral(`${meta.displayName} Tokens`)} }`);
|
|
25
19
|
}
|
|
26
20
|
else if (meta.schema && typeof meta.schema === 'string') {
|
|
27
21
|
const schemaRef = schemaLookup.get(meta.schema);
|
|
@@ -32,7 +26,7 @@ export const serializeSecretsTypes = ({ definitions, schemaLookup, secretsFile,
|
|
|
32
26
|
}
|
|
33
27
|
schemaImports.get(schemaRef.sourceFile).add(schemaRef.variableName);
|
|
34
28
|
mapEntries.push(` '${meta.secretId}'${meta.optional ? '?' : ''}: z.infer<typeof ${schemaRef.variableName}>`);
|
|
35
|
-
metaEntries.push(` '${meta.secretId}': { name: '${name}', displayName: ${
|
|
29
|
+
metaEntries.push(` '${meta.secretId}': { name: '${name}', displayName: ${tsLiteral(meta.displayName)}${meta.optional ? ', optional: true' : ''} }`);
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
32
|
}
|
|
@@ -4,7 +4,7 @@ import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
|
4
4
|
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
5
5
|
import { serializeTriggerMeta, serializeTriggerMetaTS, serializeTriggerSourceMeta, serializeTriggerSourceMetaTS, } from './serialize-trigger-meta.js';
|
|
6
6
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
7
|
-
import {
|
|
7
|
+
import { writeWiringMeta } from '../../../utils/write-wiring-meta.js';
|
|
8
8
|
export const pikkuTrigger = pikkuSessionlessFunc({
|
|
9
9
|
func: async ({ logger, config, getInspectorState }) => {
|
|
10
10
|
const visitState = await getInspectorState();
|
|
@@ -14,16 +14,16 @@ export const pikkuTrigger = pikkuSessionlessFunc({
|
|
|
14
14
|
return undefined;
|
|
15
15
|
}
|
|
16
16
|
const fullMeta = serializeTriggerMeta(triggers.meta);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
const supportsImportAttributes = schema?.supportsImportAttributes ?? false;
|
|
18
|
+
await writeWiringMeta({
|
|
19
|
+
logger,
|
|
20
|
+
meta: fullMeta,
|
|
21
|
+
metaJsonFile: triggersWiringMetaJsonFile,
|
|
22
|
+
metaFile: triggersWiringMetaFile,
|
|
23
|
+
packageMappings,
|
|
24
|
+
supportsImportAttributes,
|
|
25
|
+
serializeMetaTS: ({ jsonImportPath }) => serializeTriggerMetaTS(triggers.meta, jsonImportPath, supportsImportAttributes),
|
|
26
|
+
});
|
|
27
27
|
await writeFileInDir(logger, triggersWiringFile, serializeFileImports('wireTrigger', triggersWiringFile, triggers.files, packageMappings));
|
|
28
28
|
const sourceMetaJson = serializeTriggerSourceMeta(triggers.sourceMeta);
|
|
29
29
|
await writeFileInDir(logger, triggerSourcesMetaJsonFile, JSON.stringify(sourceMetaJson, null, 2));
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { validateAndBuildVariableDefinitionsMeta } from '@pikku/core/variable';
|
|
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 serializeVariablesTypes = ({ definitions, schemaLookup, variablesFile, packageMappings, }) => {
|
|
11
5
|
const variables = validateAndBuildVariableDefinitionsMeta(definitions, schemaLookup);
|
|
12
6
|
const variableEntries = Object.entries(variables);
|
|
@@ -28,7 +22,7 @@ export const serializeVariablesTypes = ({ definitions, schemaLookup, variablesFi
|
|
|
28
22
|
// declaring the schema import each other: reading it while the modules
|
|
29
23
|
// are still initializing throws `Cannot access '<schema>' before
|
|
30
24
|
// initialization`, and deferring the read to first use avoids the cycle.
|
|
31
|
-
metaEntries.push(` '${meta.variableId}': { name: '${name}', displayName: ${
|
|
25
|
+
metaEntries.push(` '${meta.variableId}': { name: '${name}', displayName: ${tsLiteral(meta.displayName)}, schema: () => ${schemaRef.variableName} }`);
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
28
|
}
|
|
@@ -16,7 +16,7 @@ import { serializeScenarioRegistration } from '../scenarios/serialize-scenario-r
|
|
|
16
16
|
import { buildFeaturesMeta } from '../scenarios/serialize-feature-meta.js';
|
|
17
17
|
import { serializeScenarioWorkflowMeta } from '../scenarios/serialize-scenario-meta.js';
|
|
18
18
|
import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
|
|
19
|
-
import {
|
|
19
|
+
import { writeMetaSidecar } from '../../../utils/write-wiring-meta.js';
|
|
20
20
|
import { join, dirname } from 'path';
|
|
21
21
|
import { rm } from 'fs/promises';
|
|
22
22
|
export const pikkuWorkflow = pikkuSessionlessFunc({
|
|
@@ -62,13 +62,12 @@ export const pikkuWorkflow = pikkuSessionlessFunc({
|
|
|
62
62
|
const metaDir = scenarioNameSet.has(name)
|
|
63
63
|
? config.scenarioMetaDir
|
|
64
64
|
: workflowMetaDir;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
65
|
+
await writeMetaSidecar({
|
|
66
|
+
logger,
|
|
67
|
+
meta: graphMeta,
|
|
68
|
+
metaJsonFile: join(metaDir, `${name}.gen.json`),
|
|
69
|
+
ignoreModifyComment: true,
|
|
70
|
+
});
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
// A project generated before scenarios moved out has their meta sitting in
|
|
@@ -5,6 +5,7 @@ import { assertSingleCoreVersion } from '../../utils/assert-single-core-version.
|
|
|
5
5
|
import { warnOnSplitTypeIdentity } from '../validate/type-identity-checks.js';
|
|
6
6
|
import { pruneLegacyScaffoldFiles, refreshScaffoldsImportingRemovedEntryPoints, removeRetiredScaffoldFiles, } from '../../utils/remove-legacy-scaffold-file.js';
|
|
7
7
|
import { writeSurfaceUsage } from '../surface/write-surface-usage.js';
|
|
8
|
+
import { writeSchemaArtifact } from '../db/local-db.js';
|
|
8
9
|
import { PikkuTypecheckFailedError, renderTscFull, renderTscSummary, runProjectTypecheck, } from '../../utils/tsc-check.js';
|
|
9
10
|
const scaffoldFiles = (config) => {
|
|
10
11
|
const files = [];
|
|
@@ -255,10 +256,12 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
255
256
|
]);
|
|
256
257
|
let remoteRPC = false;
|
|
257
258
|
let webhook = false;
|
|
259
|
+
let remoteJobs = false;
|
|
258
260
|
let workflowRoutes = false;
|
|
259
261
|
if (!config.addon) {
|
|
260
262
|
remoteRPC = await workflow.do('Remote RPC', 'pikkuRemoteRPC', null);
|
|
261
263
|
webhook = await workflow.do('Webhook', 'pikkuWebhook', null);
|
|
264
|
+
remoteJobs = await workflow.do('Remote jobs', 'pikkuRemoteJobs', null);
|
|
262
265
|
if (workflows) {
|
|
263
266
|
workflowRoutes = await workflow.do('Workflow routes', 'pikkuWorkflowRoutes', null);
|
|
264
267
|
}
|
|
@@ -279,6 +282,7 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
279
282
|
if (workflows ||
|
|
280
283
|
remoteRPC ||
|
|
281
284
|
webhook ||
|
|
285
|
+
remoteJobs ||
|
|
282
286
|
workflowRoutes ||
|
|
283
287
|
unresolvedSchemas) {
|
|
284
288
|
await workflow.do('Re-inspect after workflows', async () => {
|
|
@@ -319,6 +323,10 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
319
323
|
workflow.do('Channels', 'pikkuCommandChannels', null),
|
|
320
324
|
workflow.do('CLI', 'pikkuCLI', null),
|
|
321
325
|
]);
|
|
326
|
+
// Written on every build, empty when the addon has no tables: the
|
|
327
|
+
// consumer reads an absent file as a package that cannot say whether it
|
|
328
|
+
// ships a schema, which is a broken publish rather than a quiet no.
|
|
329
|
+
await writeSchemaArtifact(config.rootDir, config.outDir, config.db?.pgliteExtensions);
|
|
322
330
|
}
|
|
323
331
|
const hasFunctionRegistrations = await workflow.do('Functions', 'pikkuFunctions', null);
|
|
324
332
|
allImports.push(config.functionsMetaFile);
|
package/dist/src/services.js
CHANGED
|
@@ -177,6 +177,7 @@ export const createSingletonServices = async (config) => {
|
|
|
177
177
|
let unfilteredStateIsSetupOnly = false;
|
|
178
178
|
let inspectedTsGeneration;
|
|
179
179
|
let inspectorInvalidated = false;
|
|
180
|
+
let inspectPass = 0;
|
|
180
181
|
const releaseProgram = (state) => {
|
|
181
182
|
if (state)
|
|
182
183
|
state.program = undefined;
|
|
@@ -244,6 +245,7 @@ export const createSingletonServices = async (config) => {
|
|
|
244
245
|
config.consoleFunctionsFile,
|
|
245
246
|
config.remoteRpcWorkersFile,
|
|
246
247
|
config.webhookWorkersFile,
|
|
248
|
+
config.remoteJobsFile,
|
|
247
249
|
config.workflowRoutesFile,
|
|
248
250
|
config.publicRpcFile,
|
|
249
251
|
config.publicAgentFile,
|
|
@@ -327,6 +329,17 @@ export const createSingletonServices = async (config) => {
|
|
|
327
329
|
manifest,
|
|
328
330
|
});
|
|
329
331
|
logger.debug(`Inspector took ${Date.now() - inspectStart}ms`);
|
|
332
|
+
// One row per inspector pass under PIKKU_TIMING, next to the step table
|
|
333
|
+
// `pikku all` prints: the counts say what the pass did, the ms say what
|
|
334
|
+
// it cost here. The benchmark gates on the counts.
|
|
335
|
+
if (process.env.PIKKU_TIMING && unfilteredState.stats) {
|
|
336
|
+
const s = unfilteredState.stats;
|
|
337
|
+
inspectPass++;
|
|
338
|
+
logger.info(`[INSPECT] pass=${inspectPass} ${setupOnly ? 'setup' : 'full'} ` +
|
|
339
|
+
`files=${s.files} project=${s.projectFiles} reused=${s.filesReused} ` +
|
|
340
|
+
`types=${s.types} instantiations=${s.instantiations} symbols=${s.symbols} ` +
|
|
341
|
+
`cpu=${s.cpuMs}ms wall=${s.wallMs}ms heap=${s.heapUsedMb}MB`);
|
|
342
|
+
}
|
|
330
343
|
inspectedTsGeneration = tsGenerationAtInspect;
|
|
331
344
|
inspectorInvalidated = false;
|
|
332
345
|
releaseProgram(unfilteredState);
|
|
@@ -390,6 +390,7 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
390
390
|
workflow: 'workflowRoutesFile',
|
|
391
391
|
events: 'eventsChannelFile',
|
|
392
392
|
remoteRpc: 'remoteRpcWorkersFile',
|
|
393
|
+
remoteJobs: 'remoteJobsFile',
|
|
393
394
|
};
|
|
394
395
|
const scaffoldBlock = result.scaffold;
|
|
395
396
|
for (const [feature, outputField] of Object.entries(SCAFFOLD_OUTPUT_FIELDS)) {
|
|
@@ -415,6 +416,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
415
416
|
if (result.scaffold?.webhook && !result.webhookSchemasFile) {
|
|
416
417
|
result.webhookSchemasFile = join(resolvedScaffoldDir, 'webhook', 'webhook.schemas.gen.ts');
|
|
417
418
|
}
|
|
419
|
+
if (result.scaffold?.remoteJobs && !result.remoteJobsFile) {
|
|
420
|
+
result.remoteJobsFile = join(resolvedScaffoldDir, 'remote-jobs', 'remote-jobs.gen.ts');
|
|
421
|
+
}
|
|
418
422
|
if (result.scaffold?.workflow && !result.workflowRoutesFile) {
|
|
419
423
|
result.workflowRoutesFile = join(resolvedScaffoldDir, 'workflow', 'workflow-routes.gen.ts');
|
|
420
424
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The schemas module always sits beside the routes that import it, so there is
|
|
3
|
+
* nothing to configure: a settable path could be moved out from under the
|
|
4
|
+
* generated `./remote-jobs.schemas.gen.js` import and nothing would write it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const remoteJobsSchemasFile: (remoteJobsFile: string | undefined) => string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dirname, join } from 'node:path';
|
|
2
|
+
/**
|
|
3
|
+
* The schemas module always sits beside the routes that import it, so there is
|
|
4
|
+
* nothing to configure: a settable path could be moved out from under the
|
|
5
|
+
* generated `./remote-jobs.schemas.gen.js` import and nothing would write it.
|
|
6
|
+
*/
|
|
7
|
+
export const remoteJobsSchemasFile = (remoteJobsFile) => remoteJobsFile
|
|
8
|
+
? join(dirname(remoteJobsFile), 'remote-jobs.schemas.gen.ts')
|
|
9
|
+
: undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { rm } from 'node:fs/promises';
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { basename, dirname, join } from 'node:path';
|
|
4
|
+
import { remoteJobsSchemasFile } from './remote-jobs-schemas-file.js';
|
|
4
5
|
const scaffoldFiles = (config) => {
|
|
5
6
|
const authDir = config.authFile ? dirname(config.authFile) : undefined;
|
|
6
7
|
return [
|
|
@@ -13,6 +14,8 @@ const scaffoldFiles = (config) => {
|
|
|
13
14
|
config.publicRpcSchemasFile,
|
|
14
15
|
config.remoteRpcWorkersFile,
|
|
15
16
|
config.remoteRpcSchemasFile,
|
|
17
|
+
config.remoteJobsFile,
|
|
18
|
+
remoteJobsSchemasFile(config.remoteJobsFile),
|
|
16
19
|
config.publicAgentFile,
|
|
17
20
|
config.publicAgentSchemasFile,
|
|
18
21
|
config.consoleFunctionsFile,
|
|
@@ -33,16 +33,15 @@ export declare function reattachFunctionServices<T extends Record<string, {
|
|
|
33
33
|
services?: unknown;
|
|
34
34
|
}>>(minimalMeta: T, fullMeta: T): T;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* `description` is stripped as visualization-only, but an agent's tools are
|
|
37
|
+
* offered to the model by name and description — without it the model chooses
|
|
38
|
+
* between bare RPC names. Re-attach it for the functions some agent actually
|
|
39
|
+
* lists as a tool, rather than shipping every description at runtime.
|
|
37
40
|
*/
|
|
38
|
-
export declare function
|
|
41
|
+
export declare function reattachAgentToolDescriptions<T extends Record<string, {
|
|
42
|
+
description?: unknown;
|
|
43
|
+
}>>(minimalMeta: T, fullMeta: T, toolNames: Iterable<string>): T;
|
|
39
44
|
/**
|
|
40
|
-
*
|
|
41
|
-
* Only writes verbose file if it differs from minimal
|
|
42
|
-
*
|
|
43
|
-
* @returns Object with paths that were written
|
|
45
|
+
* Check if an object has any verbose fields that would be stripped
|
|
44
46
|
*/
|
|
45
|
-
export declare function
|
|
46
|
-
minimal: string;
|
|
47
|
-
verbose?: string;
|
|
48
|
-
}>;
|
|
47
|
+
export declare function hasVerboseFields(obj: unknown): boolean;
|
|
@@ -190,6 +190,21 @@ export function reattachFunctionServices(minimalMeta, fullMeta) {
|
|
|
190
190
|
}
|
|
191
191
|
return minimalMeta;
|
|
192
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* `description` is stripped as visualization-only, but an agent's tools are
|
|
195
|
+
* offered to the model by name and description — without it the model chooses
|
|
196
|
+
* between bare RPC names. Re-attach it for the functions some agent actually
|
|
197
|
+
* lists as a tool, rather than shipping every description at runtime.
|
|
198
|
+
*/
|
|
199
|
+
export function reattachAgentToolDescriptions(minimalMeta, fullMeta, toolNames) {
|
|
200
|
+
for (const name of toolNames) {
|
|
201
|
+
const full = fullMeta[name];
|
|
202
|
+
if (full?.description && minimalMeta[name]) {
|
|
203
|
+
minimalMeta[name].description = full.description;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return minimalMeta;
|
|
207
|
+
}
|
|
193
208
|
/**
|
|
194
209
|
* Check if an object has any verbose fields that would be stripped
|
|
195
210
|
*/
|
|
@@ -236,22 +251,3 @@ export function hasVerboseFields(obj) {
|
|
|
236
251
|
}
|
|
237
252
|
return false;
|
|
238
253
|
}
|
|
239
|
-
/**
|
|
240
|
-
* Write both minimal and verbose meta files
|
|
241
|
-
* Only writes verbose file if it differs from minimal
|
|
242
|
-
*
|
|
243
|
-
* @returns Object with paths that were written
|
|
244
|
-
*/
|
|
245
|
-
export async function writeMetaFiles(writeFile, basePath, meta) {
|
|
246
|
-
const minimalMeta = stripVerboseFields(meta);
|
|
247
|
-
const minimalPath = basePath.replace(/\.gen\.json$/, '.gen.json');
|
|
248
|
-
const verbosePath = basePath.replace(/\.gen\.json$/, '-verbose.gen.json');
|
|
249
|
-
// Always write minimal
|
|
250
|
-
await writeFile(minimalPath, JSON.stringify(minimalMeta, null, 2));
|
|
251
|
-
// Only write verbose if it has additional fields
|
|
252
|
-
if (hasVerboseFields(meta)) {
|
|
253
|
-
await writeFile(verbosePath, JSON.stringify(meta, null, 2));
|
|
254
|
-
return { minimal: minimalPath, verbose: verbosePath };
|
|
255
|
-
}
|
|
256
|
-
return { minimal: minimalPath };
|
|
257
|
-
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A display name is the human-facing label a developer wrote, so an apostrophe
|
|
3
|
+
* in it is ordinary. `JSON.stringify` emits a valid, escaped TypeScript string
|
|
4
|
+
* literal; interpolating the raw text into a quoted one terminates the string
|
|
5
|
+
* and the generated file stops parsing.
|
|
6
|
+
*/
|
|
7
|
+
export declare const tsLiteral: (value: string) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A display name is the human-facing label a developer wrote, so an apostrophe
|
|
3
|
+
* in it is ordinary. `JSON.stringify` emits a valid, escaped TypeScript string
|
|
4
|
+
* literal; interpolating the raw text into a quoted one terminates the string
|
|
5
|
+
* and the generated file stops parsing.
|
|
6
|
+
*/
|
|
7
|
+
export const tsLiteral = (value) => JSON.stringify(value);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CLILogger } from '../services/cli-logger.service.js';
|
|
2
|
+
export interface WriteMetaSidecarOptions {
|
|
3
|
+
logger: CLILogger;
|
|
4
|
+
/** The full meta, verbose fields and all. */
|
|
5
|
+
meta: unknown;
|
|
6
|
+
metaJsonFile: string;
|
|
7
|
+
/**
|
|
8
|
+
* The copy to write to `metaJsonFile`, when a wiring needs more than
|
|
9
|
+
* `stripVerboseFields` gives it — the functions wiring reattaches services
|
|
10
|
+
* an addon consumer cannot resolve without them.
|
|
11
|
+
*/
|
|
12
|
+
minimalMeta?: unknown;
|
|
13
|
+
ignoreModifyComment?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface WriteWiringMetaOptions extends WriteMetaSidecarOptions {
|
|
16
|
+
metaFile: string;
|
|
17
|
+
packageMappings: Record<string, string>;
|
|
18
|
+
supportsImportAttributes: boolean;
|
|
19
|
+
serializeMetaTS: (imports: {
|
|
20
|
+
jsonImportPath: string;
|
|
21
|
+
importStatement: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Writes a wiring's metadata sidecar: the minimal JSON every runtime reads,
|
|
26
|
+
* and a `-verbose` sibling only when there is something extra to say.
|
|
27
|
+
*
|
|
28
|
+
* The split exists because the minimal copy is imported by generated code and
|
|
29
|
+
* ships to every consumer, while descriptions, tags and step names are read off
|
|
30
|
+
* disk by whatever documents the wiring — the console needs them, a running
|
|
31
|
+
* server never does.
|
|
32
|
+
*/
|
|
33
|
+
export declare const writeMetaSidecar: ({ logger, meta, metaJsonFile, minimalMeta, ignoreModifyComment, }: WriteMetaSidecarOptions) => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Writes a wiring's metadata sidecar and the TypeScript module that imports it.
|
|
36
|
+
*
|
|
37
|
+
* The module is what makes the sidecar ship: tsc only copies a .json into dist
|
|
38
|
+
* when something imports it, and an addon publishes only its compiled output —
|
|
39
|
+
* inlining the meta instead would leave a consumer with nothing to merge.
|
|
40
|
+
* `supportsImportAttributes` is the caller's runtime, not this one's: a target
|
|
41
|
+
* that predates import attributes rejects the `with { type: 'json' }` form.
|
|
42
|
+
*/
|
|
43
|
+
export declare const writeWiringMeta: ({ metaFile, packageMappings, supportsImportAttributes, serializeMetaTS, ...sidecar }: WriteWiringMetaOptions) => Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { writeFileInDir } from './file-writer.js';
|
|
2
|
+
import { getFileImportRelativePath } from './file-import-path.js';
|
|
3
|
+
import { stripVerboseFields, hasVerboseFields } from './strip-verbose-meta.js';
|
|
4
|
+
const verboseSiblingOf = (metaJsonFile) => metaJsonFile.endsWith('.gen.json')
|
|
5
|
+
? metaJsonFile.replace(/\.gen\.json$/, '-verbose.gen.json')
|
|
6
|
+
: metaJsonFile.replace(/(\.\w+)$/, '-verbose$1');
|
|
7
|
+
/**
|
|
8
|
+
* Writes a wiring's metadata sidecar: the minimal JSON every runtime reads,
|
|
9
|
+
* and a `-verbose` sibling only when there is something extra to say.
|
|
10
|
+
*
|
|
11
|
+
* The split exists because the minimal copy is imported by generated code and
|
|
12
|
+
* ships to every consumer, while descriptions, tags and step names are read off
|
|
13
|
+
* disk by whatever documents the wiring — the console needs them, a running
|
|
14
|
+
* server never does.
|
|
15
|
+
*/
|
|
16
|
+
export const writeMetaSidecar = async ({ logger, meta, metaJsonFile, minimalMeta, ignoreModifyComment, }) => {
|
|
17
|
+
const writeOptions = ignoreModifyComment ? { ignoreModifyComment } : undefined;
|
|
18
|
+
await writeFileInDir(logger, metaJsonFile, JSON.stringify(minimalMeta ?? stripVerboseFields(meta), null, 2), writeOptions);
|
|
19
|
+
if (!hasVerboseFields(meta)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const verbosePath = verboseSiblingOf(metaJsonFile);
|
|
23
|
+
if (verbosePath === metaJsonFile) {
|
|
24
|
+
logger.warn(`Cannot derive verbose path from ${metaJsonFile}, skipping verbose metadata`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
await writeFileInDir(logger, verbosePath, JSON.stringify(meta, null, 2), writeOptions);
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Writes a wiring's metadata sidecar and the TypeScript module that imports it.
|
|
31
|
+
*
|
|
32
|
+
* The module is what makes the sidecar ship: tsc only copies a .json into dist
|
|
33
|
+
* when something imports it, and an addon publishes only its compiled output —
|
|
34
|
+
* inlining the meta instead would leave a consumer with nothing to merge.
|
|
35
|
+
* `supportsImportAttributes` is the caller's runtime, not this one's: a target
|
|
36
|
+
* that predates import attributes rejects the `with { type: 'json' }` form.
|
|
37
|
+
*/
|
|
38
|
+
export const writeWiringMeta = async ({ metaFile, packageMappings, supportsImportAttributes, serializeMetaTS, ...sidecar }) => {
|
|
39
|
+
await writeMetaSidecar(sidecar);
|
|
40
|
+
const jsonImportPath = getFileImportRelativePath(metaFile, sidecar.metaJsonFile, packageMappings);
|
|
41
|
+
const importStatement = supportsImportAttributes
|
|
42
|
+
? `import metaData from '${jsonImportPath}' with { type: 'json' }`
|
|
43
|
+
: `import metaData from '${jsonImportPath}'`;
|
|
44
|
+
await writeFileInDir(sidecar.logger, metaFile, serializeMetaTS({ jsonImportPath, importStatement }));
|
|
45
|
+
};
|