@pikku/cli 0.12.119 → 0.12.121
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 +225 -0
- package/console-app/assets/{abnfDiagram-N423BO3Z-CiK5F2ml.js → abnfDiagram-N423BO3Z-Dfq94a7u.js} +1 -1
- package/console-app/assets/architecture-TIHT7OUA-CA-Di-O3.js +1 -0
- package/console-app/assets/{architectureDiagram-T3A2C74G-g4Elcs_0.js → architectureDiagram-T3A2C74G-C9MjP0IU.js} +1 -1
- package/console-app/assets/{blockDiagram-VBNYF7ZC-CI6muc3M.js → blockDiagram-VBNYF7ZC-CGgHSlOO.js} +1 -1
- package/console-app/assets/{c4Diagram-5PPSVZJV-CjzL9yGp.js → c4Diagram-5PPSVZJV-3kzckivq.js} +1 -1
- package/console-app/assets/channel-UOxM22B3.js +1 -0
- package/console-app/assets/{chunk-2GRJ4B5K-C68TKOLb.js → chunk-2GRJ4B5K-UZ1q29J_.js} +1 -1
- package/console-app/assets/{chunk-4I5QYGJK-D_DINIPO.js → chunk-4I5QYGJK-bq4iSS6S.js} +1 -1
- package/console-app/assets/{chunk-5RXB4S5H-D8mEuiea.js → chunk-5RXB4S5H-BCeU8nXq.js} +1 -1
- package/console-app/assets/{chunk-6Q2QTUOP-CVNqLnb8.js → chunk-6Q2QTUOP-DpsTVhit.js} +1 -1
- package/console-app/assets/{chunk-7Z6QIM7H-Bnih6HyS.js → chunk-7Z6QIM7H-I6XKkv2A.js} +1 -1
- package/console-app/assets/{chunk-GF5L2VYU-C5efrbFt.js → chunk-GF5L2VYU-aYODFCZ6.js} +1 -1
- package/console-app/assets/{chunk-I66GZJ75-dckv50K3.js → chunk-I66GZJ75-CWdPrY4a.js} +1 -1
- package/console-app/assets/{chunk-JQJVKLGR-HirBo6LQ.js → chunk-JQJVKLGR-D5bHP4bt.js} +1 -1
- package/console-app/assets/{chunk-KBJHAD2P-lknhmPj0.js → chunk-KBJHAD2P-B-Spac9o.js} +1 -1
- package/console-app/assets/{chunk-NSK5VX7P-tGAl7zxF.js → chunk-NSK5VX7P-0jZVLBhi.js} +1 -1
- package/console-app/assets/{chunk-QR6OTTB3-BlSKCrEq.js → chunk-QR6OTTB3-BurXFOtV.js} +1 -1
- package/console-app/assets/{chunk-RYQCIY6F-CwQmwEV-.js → chunk-RYQCIY6F-C4zacxhH.js} +1 -1
- package/console-app/assets/{chunk-UBXNYLIW-D1Dn6ZK0.js → chunk-UBXNYLIW-7RthekQ-.js} +1 -1
- package/console-app/assets/{chunk-W5SLKNZC-DOkZHhST.js → chunk-W5SLKNZC-rq3UcMTy.js} +1 -1
- package/console-app/assets/{chunk-WRU74C26-CB4orIKm.js → chunk-WRU74C26-DUX-oZjQ.js} +1 -1
- package/console-app/assets/chunk-XXDRQBXY-gIL1rRSY.js +1 -0
- package/console-app/assets/classDiagram-JCYQIIEL-BwV1w5At.js +1 -0
- package/console-app/assets/classDiagram-v2-OCEON4UE-BwV1w5At.js +1 -0
- package/console-app/assets/{cose-bilkent-JH36ORCC-stBhaqpU.js → cose-bilkent-JH36ORCC-DZn35HFs.js} +1 -1
- package/console-app/assets/{cynefin-VYW2F7L2-Bb1nmKWZ.js → cynefin-VYW2F7L2-mZlOMKNi.js} +1 -1
- package/console-app/assets/{cynefinDiagram-MW4NZA55-Bp8fMJi-.js → cynefinDiagram-MW4NZA55-uUAfUoag.js} +1 -1
- package/console-app/assets/{dagre-DshmzimC.js → dagre-DfTmIhGN.js} +1 -1
- package/console-app/assets/{dagre-VZM6K2ZE-DIl1klf5.js → dagre-VZM6K2ZE-7oTddCss.js} +1 -1
- package/console-app/assets/{diagram-7IWD3JNH-DdkSOxKT.js → diagram-7IWD3JNH-D6TR4TlN.js} +1 -1
- package/console-app/assets/{diagram-B4RE2ZJO-9Dj9O4L8.js → diagram-B4RE2ZJO-BZwUFLzC.js} +1 -1
- package/console-app/assets/{diagram-LBJQPF4R-CxBb73tU.js → diagram-LBJQPF4R-B4Ug2xRo.js} +1 -1
- package/console-app/assets/{diagram-Q27KOJAE-CPpUmnvb.js → diagram-Q27KOJAE-Fpr_Cahs.js} +1 -1
- package/console-app/assets/{diagram-UB23O5K3-7wV_Db6W.js → diagram-UB23O5K3-d0X7PA-5.js} +1 -1
- package/console-app/assets/{ebnfDiagram-BXEA7PRR-Cxzbf8pk.js → ebnfDiagram-BXEA7PRR-DExP954c.js} +1 -1
- package/console-app/assets/{erDiagram-JOGREHBK-BBPLq83P.js → erDiagram-JOGREHBK-WdnXmG8f.js} +1 -1
- package/console-app/assets/eventmodeling-45OFAUF4-DXnDrAdV.js +1 -0
- package/console-app/assets/flowDiagram-UKHOOZJN-UixAvy5Z.js +1 -0
- package/console-app/assets/{ganttDiagram-PKOTCBZU-Erh7WK4H.js → ganttDiagram-PKOTCBZU-ADJHCyvl.js} +1 -1
- package/console-app/assets/{gitGraph-TEB2WS4Q-o5FLRF57.js → gitGraph-TEB2WS4Q-BPcXt1vK.js} +1 -1
- package/console-app/assets/{gitGraphDiagram-DS77QQ5N-BFbsaenX.js → gitGraphDiagram-DS77QQ5N-DFhenfUX.js} +1 -1
- package/console-app/assets/{index-w2ZoJr8X.js → index-BwP6EcJr.js} +184 -184
- package/console-app/assets/{info-DKCQHKI2-Dkcrdr1w.js → info-DKCQHKI2-BsE7egna.js} +1 -1
- package/console-app/assets/{infoDiagram-6WML65LV-iZVC5Wzy.js → infoDiagram-6WML65LV-BmVqXMw0.js} +1 -1
- package/console-app/assets/{ishikawaDiagram-WSZJBQD7-BjV8LLeA.js → ishikawaDiagram-WSZJBQD7-CdFTPIY5.js} +1 -1
- package/console-app/assets/{journeyDiagram-NVQOT4AX-D3rpLjYi.js → journeyDiagram-NVQOT4AX-DC8CKdJk.js} +1 -1
- package/console-app/assets/{kanban-definition-27J2QSJJ-Dds5TFyv.js → kanban-definition-27J2QSJJ-Bo7kRcLN.js} +1 -1
- package/console-app/assets/{line-D1rUAT18.js → line-5nUqh22u.js} +1 -1
- package/console-app/assets/{linear-fQ_6Sc79.js → linear-82KoPtTH.js} +1 -1
- package/console-app/assets/{mermaid-parser.core-B9Q-4IXF.js → mermaid-parser.core-R240ylPw.js} +3 -3
- package/console-app/assets/{mermaid.core-bPhADShw.js → mermaid.core-BZ3jSM6D.js} +4 -4
- package/console-app/assets/{mindmap-definition-FAOFIHXS-CULlU6Fy.js → mindmap-definition-FAOFIHXS-x1K54VeO.js} +1 -1
- package/console-app/assets/{packet-7NZHBO7P-DpwzoQpc.js → packet-7NZHBO7P-CE2Lun0t.js} +1 -1
- package/console-app/assets/{pegDiagram-VL7TDLO6-B9fKKc4F.js → pegDiagram-VL7TDLO6-CpGZYdUz.js} +1 -1
- package/console-app/assets/{pie-RZYD4A2V-DkXpqWAI.js → pie-RZYD4A2V-Hf5MOyY8.js} +1 -1
- package/console-app/assets/{pieDiagram-7S7Q4E2Y-Bcpn2rUM.js → pieDiagram-7S7Q4E2Y-0J5H7r7g.js} +1 -1
- package/console-app/assets/{quadrantDiagram-CIZ2JOQS-Bd5wWFj_.js → quadrantDiagram-CIZ2JOQS-DWtYi8O-.js} +1 -1
- package/console-app/assets/{radar-I7S5WNFK-ylw-u3HI.js → radar-I7S5WNFK-BgtvrX4w.js} +1 -1
- package/console-app/assets/{railroad-3IZDKUUU-D4LMucL-.js → railroad-3IZDKUUU-CeR0NhLL.js} +1 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-BEVU16-y.js +1 -0
- package/console-app/assets/railroad-ebnf-EBAXGLYW-WT4rrGXf.js +1 -0
- package/console-app/assets/railroad-peg-LSFZ7HO6-BnObCMjn.js +1 -0
- package/console-app/assets/{railroadDiagram-AXF67PYL-CZukQql9.js → railroadDiagram-AXF67PYL-CUIn_gPf.js} +1 -1
- package/console-app/assets/{requirementDiagram-LRYGKXZP-Ou4nRENK.js → requirementDiagram-LRYGKXZP-Ds9Aqcts.js} +1 -1
- package/console-app/assets/{sankeyDiagram-W5VNT64P-BKdG-c_o.js → sankeyDiagram-W5VNT64P-CKhuya4d.js} +1 -1
- package/console-app/assets/{sequenceDiagram-SI44F4Z6-Dc7d5obe.js → sequenceDiagram-SI44F4Z6-DKgOmdzz.js} +1 -1
- package/console-app/assets/{src-BFb2oeKx.js → src-DwHVY--Z.js} +1 -1
- package/console-app/assets/{stateDiagram-OKZ733FA-BA9fuN7b.js → stateDiagram-OKZ733FA-CPIfaZie.js} +1 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-DHcCmJ1C.js +1 -0
- package/console-app/assets/{swimlanes-SLNWSIFB-l-ETgM83.js → swimlanes-SLNWSIFB-8q3lK4RS.js} +1 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-B1uT0NiL.js +8 -0
- package/console-app/assets/{timeline-definition-Z64GVDOM-Uj_ByeVr.js → timeline-definition-Z64GVDOM-CHHi2Rpq.js} +1 -1
- package/console-app/assets/{treeView-QDETBFTQ-BvFRkVGY.js → treeView-QDETBFTQ-DrLHlsII.js} +1 -1
- package/console-app/assets/{treemap-6X3UGDF4-BV5T7Dw9.js → treemap-6X3UGDF4-C3saYKuK.js} +1 -1
- package/console-app/assets/{vennDiagram-T6HMQDX7-DAFU8gAo.js → vennDiagram-T6HMQDX7-CdyzNiAu.js} +1 -1
- package/console-app/assets/{wardley-OPB4EBWU-MLNuhuiA.js → wardley-OPB4EBWU-BSrymyse.js} +1 -1
- package/console-app/assets/{wardleyDiagram-T6FBY63Y-B1lCTfi1.js → wardleyDiagram-T6FBY63Y-CCW6rhEo.js} +1 -1
- package/console-app/assets/{xychartDiagram-ELKLHX3M-Bw3zhuWc.js → xychartDiagram-ELKLHX3M-BQvPaxzg.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 +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/error/index.d.ts +1 -1
- package/dist/.pikku/error/index.js +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/function/index.d.ts +1 -1
- package/dist/.pikku/function/index.js +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +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 +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/gateway/index.d.ts +1 -1
- package/dist/.pikku/gateway/index.js +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
- package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
- package/dist/.pikku/http/index.d.ts +1 -1
- package/dist/.pikku/http/index.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/index.d.ts +1 -1
- package/dist/.pikku/mcp/index.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/middleware/index.d.ts +1 -1
- package/dist/.pikku/middleware/index.js +1 -1
- package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +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/scenarios/index.d.ts +1 -1
- package/dist/.pikku/scenarios/index.js +1 -1
- package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/scheduler/index.d.ts +1 -1
- package/dist/.pikku/scheduler/index.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +1 -1
- package/dist/.pikku/scopes/index.d.ts +1 -1
- package/dist/.pikku/scopes/index.js +1 -1
- package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/index.d.ts +1 -1
- package/dist/.pikku/secrets/index.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/setup/index.d.ts +1 -1
- package/dist/.pikku/setup/index.js +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
- package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/trigger/index.d.ts +1 -1
- package/dist/.pikku/trigger/index.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/index.d.ts +1 -1
- package/dist/.pikku/variables/index.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/index.d.ts +1 -1
- package/dist/.pikku/workflow/index.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/fabric/functions/validate.function.js +22 -2
- package/dist/src/functions/wirings/agent/serialize-public-agent.js +7 -19
- package/dist/src/functions/wirings/console/serialize-console-functions.js +3 -12
- package/dist/src/functions/wirings/emails/serialize-emails.d.ts +10 -0
- package/dist/src/functions/wirings/emails/serialize-emails.js +30 -173
- package/dist/src/functions/wirings/virtual-user/serialize-virtual-user-functions.js +171 -405
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +7 -7
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +11 -148
- package/dist/src/utils/pikku-cli-config.d.ts +18 -0
- package/dist/src/utils/pikku-cli-config.js +39 -0
- package/package.json +6 -6
- package/surface.json +2 -2
- package/console-app/assets/architecture-TIHT7OUA-FMO1RByN.js +0 -1
- package/console-app/assets/channel-Dp8A5NJg.js +0 -1
- package/console-app/assets/chunk-XXDRQBXY-BMybY6E-.js +0 -1
- package/console-app/assets/classDiagram-JCYQIIEL-C-K-UAUR.js +0 -1
- package/console-app/assets/classDiagram-v2-OCEON4UE-C-K-UAUR.js +0 -1
- package/console-app/assets/eventmodeling-45OFAUF4-CLUnygIv.js +0 -1
- package/console-app/assets/flowDiagram-UKHOOZJN-D3mDcWWx.js +0 -1
- package/console-app/assets/railroad-abnf-AHOZXSZD-CRTVzK1g.js +0 -1
- package/console-app/assets/railroad-ebnf-EBAXGLYW-CB13ugAF.js +0 -1
- package/console-app/assets/railroad-peg-LSFZ7HO6-AN8zyQYp.js +0 -1
- package/console-app/assets/stateDiagram-v2-UEYNNEHI-D13a6mUd.js +0 -1
- package/console-app/assets/swimlanesDiagram-ULZ7WXOC-BsC-B2Z9.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.121
|
|
3
3
|
*/
|
|
4
4
|
import { WorkflowCancelledException } from '@pikku/core/workflow';
|
|
5
5
|
import type { PikkuWorkflowGraphConfig, PikkuWorkflowGraphResult } from '@pikku/core/workflow';
|
package/dist/bin/pikku-bin.mjs
CHANGED
|
@@ -11,8 +11,8 @@ async function checkForUpdate() {
|
|
|
11
11
|
})
|
|
12
12
|
if (!res.ok) return
|
|
13
13
|
const { version: latest } = await res.json()
|
|
14
|
-
if (latest !== '0.12.
|
|
15
|
-
process.stderr.write(`\n Update available 0.12.
|
|
14
|
+
if (latest !== '0.12.121') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.121 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
|
@@ -1143,10 +1143,30 @@ export async function runValidate(startDir = process.cwd(), opts = {}) {
|
|
|
1143
1143
|
if (!ent.isDirectory())
|
|
1144
1144
|
continue;
|
|
1145
1145
|
const appPath = join(appsRoot, ent.name);
|
|
1146
|
-
const
|
|
1146
|
+
const settingsPath = join(appPath, 'project.inlang', 'settings.json');
|
|
1147
|
+
const settings = await readJsonSafe(settingsPath);
|
|
1147
1148
|
if (!settings)
|
|
1148
1149
|
continue;
|
|
1149
|
-
|
|
1150
|
+
// `baseLocale` names the message SOURCE — the catalogue every other
|
|
1151
|
+
// locale is cloned from and translated against — not the language the
|
|
1152
|
+
// app is served in. Pointing it at the product's language looks right,
|
|
1153
|
+
// because the app does come up in that language, and quietly makes the
|
|
1154
|
+
// project single-language forever: there is no en.json to add a locale
|
|
1155
|
+
// from, and repointing it later re-authors every key. The setting that
|
|
1156
|
+
// decides what a first-time visitor opens in is active.json's
|
|
1157
|
+
// defaultLocale, which is a separate file for exactly this reason.
|
|
1158
|
+
const baseLocale = settings.baseLocale ?? 'en';
|
|
1159
|
+
if (baseLocale !== 'en') {
|
|
1160
|
+
const declared = Array.isArray(settings.locales)
|
|
1161
|
+
? settings.locales.filter((l) => typeof l === 'string')
|
|
1162
|
+
: [];
|
|
1163
|
+
w(`app-base-locale-not-english-${ent.name}`, `apps/${ent.name}/project.inlang/settings.json sets baseLocale to "${baseLocale}" — that names the message source, not the language the app is served in, so this app has no English catalogue to add a second language from`, settingsPath, lines('Serving the app in a language is a different setting from authoring the messages in one:', ` 1. settings.json: { "baseLocale": "en", "locales": ["en", "${baseLocale}"] }`, ` 2. src/i18n/active.json: { "defaultLocale": "${baseLocale}" } (or: fabric i18n --default-locale ${baseLocale})`, `Keys and their English values stay in messages/en.json; messages/${baseLocale}.json holds the ${baseLocale} values.`, ...(declared.length && !declared.includes('en')
|
|
1164
|
+
? [
|
|
1165
|
+
`Note this is a re-key, not a rename: messages/${baseLocale}.json is currently the source, so its keys have to survive the move.`,
|
|
1166
|
+
]
|
|
1167
|
+
: []), 'Identifiers are unaffected either way — functions, components, types, tables and columns are English in every project.'));
|
|
1168
|
+
}
|
|
1169
|
+
const catalogue = await readJsonSafe(join(appPath, 'messages', `${baseLocale}.json`));
|
|
1150
1170
|
if (!catalogue)
|
|
1151
1171
|
continue;
|
|
1152
1172
|
for (const [key, value] of Object.entries(catalogue)) {
|
|
@@ -53,7 +53,11 @@ export const ThreadRef = z.object({
|
|
|
53
53
|
|
|
54
54
|
export const ThreadDeleted = z.object({ deleted: z.boolean() })
|
|
55
55
|
`;
|
|
56
|
-
const functions = `import {
|
|
56
|
+
const functions = `import {
|
|
57
|
+
agentCallOptions,
|
|
58
|
+
canAccessThread,
|
|
59
|
+
threadOwnerConstraint,
|
|
60
|
+
} from '@pikku/core/agent'
|
|
57
61
|
import { pikkuSessionlessFunc } from '${leaf('function')}'
|
|
58
62
|
import { pikkuPermission } from '${leaf('auth')}'
|
|
59
63
|
import { defineHTTPRoutes, wireHTTPRoutes } from '${leaf('http')}'
|
|
@@ -87,15 +91,7 @@ export const agentCaller = pikkuSessionlessFunc({
|
|
|
87
91
|
auth: false,
|
|
88
92
|
input: AgentCall,
|
|
89
93
|
func: async (_services, data, { rpc }) => {
|
|
90
|
-
return await rpc.agent.run(data.agentName as any,
|
|
91
|
-
message: data.message,
|
|
92
|
-
threadId: data.threadId,
|
|
93
|
-
resourceId: data.resourceId,
|
|
94
|
-
...(data.attachments ? { attachments: data.attachments } : {}),
|
|
95
|
-
...(data.model ? { model: data.model } : {}),
|
|
96
|
-
...(data.temperature !== undefined ? { temperature: data.temperature } : {}),
|
|
97
|
-
...(data.context ? { context: data.context } : {}),
|
|
98
|
-
})
|
|
94
|
+
return await rpc.agent.run(data.agentName as any, agentCallOptions(data))
|
|
99
95
|
},
|
|
100
96
|
})
|
|
101
97
|
|
|
@@ -104,15 +100,7 @@ export const agentStreamCaller = pikkuSessionlessFunc({
|
|
|
104
100
|
auth: false,
|
|
105
101
|
input: AgentCall,
|
|
106
102
|
func: async (_services, data, { rpc }) => {
|
|
107
|
-
await rpc.agent.stream(data.agentName as any,
|
|
108
|
-
message: data.message,
|
|
109
|
-
threadId: data.threadId,
|
|
110
|
-
resourceId: data.resourceId,
|
|
111
|
-
...(data.attachments ? { attachments: data.attachments } : {}),
|
|
112
|
-
...(data.model ? { model: data.model } : {}),
|
|
113
|
-
...(data.temperature !== undefined ? { temperature: data.temperature } : {}),
|
|
114
|
-
...(data.context ? { context: data.context } : {}),
|
|
115
|
-
})
|
|
103
|
+
await rpc.agent.stream(data.agentName as any, agentCallOptions(data))
|
|
116
104
|
},
|
|
117
105
|
})
|
|
118
106
|
|
|
@@ -40,13 +40,8 @@ export const pikkuConsoleGetVariable = pikkuFunc({
|
|
|
40
40
|
if (!exists) {
|
|
41
41
|
return { exists: false, value: null }
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return { exists: true, value }
|
|
46
|
-
} catch {
|
|
47
|
-
const value = await variables.get(variableId)
|
|
48
|
-
return { exists: true, value }
|
|
49
|
-
}
|
|
43
|
+
const value = await variables.get(variableId)
|
|
44
|
+
return { exists: true, value }
|
|
50
45
|
},
|
|
51
46
|
})
|
|
52
47
|
|
|
@@ -57,11 +52,7 @@ export const pikkuConsoleSetVariable = pikkuFunc({
|
|
|
57
52
|
input: SetVariable,
|
|
58
53
|
output: Success,
|
|
59
54
|
func: async ({ variables }, { variableId, value }) => {
|
|
60
|
-
|
|
61
|
-
await variables.set(variableId, value)
|
|
62
|
-
} else {
|
|
63
|
-
await variables.set(variableId, value)
|
|
64
|
-
}
|
|
55
|
+
await variables.set(variableId, value)
|
|
65
56
|
return { success: true }
|
|
66
57
|
},
|
|
67
58
|
})
|
|
@@ -16,5 +16,15 @@ type SerializeEmailsInput = {
|
|
|
16
16
|
partials: Record<string, string>;
|
|
17
17
|
templates: Record<string, EmailTemplateAssets>;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* The generated module is the assets and the types over them — the renderer
|
|
21
|
+
* itself is `renderEmail` in @pikku/core, which is the same for every
|
|
22
|
+
* application and which nothing here could typecheck or lint.
|
|
23
|
+
*
|
|
24
|
+
* What is genuinely per-application: the four asset blobs, the union of
|
|
25
|
+
* template and locale names taken from their keys, and `TemplateVariableMap`,
|
|
26
|
+
* which is what makes `renderEmailTemplate` reject a variable the named
|
|
27
|
+
* template does not declare.
|
|
28
|
+
*/
|
|
19
29
|
export declare const serializeEmailsModule: ({ theme, locales, partials, templates, }: SerializeEmailsInput) => string;
|
|
20
30
|
export {};
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generated module is the assets and the types over them — the renderer
|
|
3
|
+
* itself is `renderEmail` in @pikku/core, which is the same for every
|
|
4
|
+
* application and which nothing here could typecheck or lint.
|
|
5
|
+
*
|
|
6
|
+
* What is genuinely per-application: the four asset blobs, the union of
|
|
7
|
+
* template and locale names taken from their keys, and `TemplateVariableMap`,
|
|
8
|
+
* which is what makes `renderEmailTemplate` reject a variable the named
|
|
9
|
+
* template does not declare.
|
|
10
|
+
*/
|
|
1
11
|
export const serializeEmailsModule = ({ theme, locales, partials, templates, }) => {
|
|
2
12
|
const serializedTheme = JSON.stringify(theme, null, 2);
|
|
3
13
|
const serializedLocales = JSON.stringify(locales, null, 2);
|
|
4
14
|
const serializedPartials = JSON.stringify(partials, null, 2);
|
|
5
15
|
const serializedTemplates = JSON.stringify(templates, null, 2);
|
|
6
|
-
return `
|
|
16
|
+
return `import { renderEmail, type EmailAssets } from '@pikku/core/services'
|
|
17
|
+
|
|
18
|
+
type EmailPrimitive = string | number | boolean | null | undefined
|
|
7
19
|
type EmailTemplateValue = EmailPrimitive | Record<string, unknown> | Array<unknown>
|
|
8
20
|
|
|
9
21
|
const EMAIL_THEME = ${serializedTheme} as const
|
|
@@ -48,192 +60,37 @@ export type RenderedEmail<TName extends EmailTemplateName> = {
|
|
|
48
60
|
hash: (typeof EMAIL_TEMPLATES)[TName]['hashes'][EmailLocale]['contentHash']
|
|
49
61
|
}
|
|
50
62
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return typeof current === 'string' || typeof current === 'number'
|
|
61
|
-
? String(current)
|
|
62
|
-
: ''
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const HTML_ESCAPES: Record<string, string> = {
|
|
66
|
-
'&': '&',
|
|
67
|
-
'<': '<',
|
|
68
|
-
'>': '>',
|
|
69
|
-
'"': '"',
|
|
70
|
-
"'": ''',
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function escapeHtml(value: string): string {
|
|
74
|
-
return value.replace(/[&<>"']/g, (char) => HTML_ESCAPES[char] ?? char)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Matches the raw {{{ value }}} form before the escaped {{ value }} form, so the
|
|
78
|
-
// opt-in escape hatch is never mistaken for a normal substitution.
|
|
79
|
-
const TEMPLATE_TOKEN = /\\{\\{\\{\\s*([^{}]+?)\\s*\\}\\}\\}|\\{\\{\\s*([^}]+?)\\s*\\}\\}/g
|
|
80
|
-
|
|
81
|
-
const PARTIAL_TOKEN = /\\{\\{\\s*>\\s*([a-zA-Z0-9-_/.]+)\\s*\\}\\}/g
|
|
82
|
-
|
|
83
|
-
const MAX_TEMPLATE_DEPTH = 5
|
|
84
|
-
|
|
85
|
-
// theme.json and the locale files ship with the templates, so they are treated as
|
|
86
|
-
// template-author input: expanded before caller data and allowed to contain their
|
|
87
|
-
// own placeholders. Everything else is caller-supplied.
|
|
88
|
-
const TRUSTED_ROOTS = ['theme', 't']
|
|
89
|
-
|
|
90
|
-
function isTrustedKey(key: string): boolean {
|
|
91
|
-
return TRUSTED_ROOTS.includes(String(key.split('.')[0]))
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function readToken(rawTriple: unknown, rawDouble: unknown) {
|
|
95
|
-
const raw = typeof rawTriple === 'string'
|
|
96
|
-
return { raw, key: String(raw ? rawTriple : rawDouble).trim() }
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function expandPartials(source: string, depth = 0): string {
|
|
100
|
-
if (depth >= MAX_TEMPLATE_DEPTH) return source
|
|
101
|
-
let found = false
|
|
102
|
-
const expanded = source.replace(PARTIAL_TOKEN, (_match, partialName) => {
|
|
103
|
-
found = true
|
|
104
|
-
const partial =
|
|
105
|
-
EMAIL_PARTIALS[String(partialName).trim() as keyof typeof EMAIL_PARTIALS]
|
|
106
|
-
return typeof partial === 'string' ? partial : ''
|
|
107
|
-
})
|
|
108
|
-
return found ? expandPartials(expanded, depth + 1) : expanded
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function expandTrusted(
|
|
112
|
-
source: string,
|
|
113
|
-
context: Record<string, unknown>,
|
|
114
|
-
escape: boolean
|
|
115
|
-
): string {
|
|
116
|
-
let rendered = source
|
|
117
|
-
for (let i = 0; i < MAX_TEMPLATE_DEPTH; i += 1) {
|
|
118
|
-
let found = false
|
|
119
|
-
const next = rendered.replace(
|
|
120
|
-
TEMPLATE_TOKEN,
|
|
121
|
-
(match, rawTriple, rawDouble) => {
|
|
122
|
-
const { raw, key } = readToken(rawTriple, rawDouble)
|
|
123
|
-
if (!isTrustedKey(key)) return match
|
|
124
|
-
found = true
|
|
125
|
-
const value = getNestedValue(context, key)
|
|
126
|
-
return raw || !escape ? value : escapeHtml(value)
|
|
127
|
-
}
|
|
128
|
-
)
|
|
129
|
-
if (!found || next === rendered) break
|
|
130
|
-
rendered = next
|
|
131
|
-
}
|
|
132
|
-
return rendered
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// A single substitution pass — the replacement text is never rescanned, so a
|
|
136
|
-
// caller-supplied value can never be reinterpreted as a template.
|
|
137
|
-
function substitute(
|
|
138
|
-
source: string,
|
|
139
|
-
context: Record<string, unknown>,
|
|
140
|
-
escape: boolean
|
|
141
|
-
): string {
|
|
142
|
-
return source.replace(TEMPLATE_TOKEN, (_match, rawTriple, rawDouble) => {
|
|
143
|
-
const { raw, key } = readToken(rawTriple, rawDouble)
|
|
144
|
-
if (key === 'content') {
|
|
145
|
-
return typeof context.content === 'string' ? context.content : ''
|
|
146
|
-
}
|
|
147
|
-
if (key.startsWith('>')) {
|
|
148
|
-
return ''
|
|
149
|
-
}
|
|
150
|
-
const value = getNestedValue(context, key)
|
|
151
|
-
return raw || !escape ? value : escapeHtml(value)
|
|
152
|
-
})
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function renderTemplate(
|
|
156
|
-
source: string,
|
|
157
|
-
context: Record<string, unknown>,
|
|
158
|
-
escape: boolean
|
|
159
|
-
): string {
|
|
160
|
-
const composed = expandTrusted(expandPartials(source), context, escape)
|
|
161
|
-
return substitute(composed, context, escape)
|
|
162
|
-
}
|
|
63
|
+
// The assets are frozen literals so their keys can drive the types above; the
|
|
64
|
+
// renderer reads them as plain records.
|
|
65
|
+
const EMAIL_ASSETS = {
|
|
66
|
+
theme: EMAIL_THEME,
|
|
67
|
+
locales: EMAIL_LOCALES,
|
|
68
|
+
partials: EMAIL_PARTIALS,
|
|
69
|
+
templates: EMAIL_TEMPLATES,
|
|
70
|
+
} as unknown as EmailAssets
|
|
163
71
|
|
|
164
72
|
export const EMAILS = EMAIL_TEMPLATES
|
|
165
73
|
|
|
166
74
|
export function renderEmailTemplate<TName extends EmailTemplateName>(
|
|
167
75
|
input: RenderEmailInput<TName>
|
|
168
76
|
): RenderedEmail<TName> {
|
|
169
|
-
const locale
|
|
170
|
-
|
|
171
|
-
if (!template) {
|
|
172
|
-
throw new Error(\`Unknown email template: \${String(input.name)}\`)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const strings = EMAIL_LOCALES[locale]
|
|
176
|
-
if (!strings) {
|
|
177
|
-
throw new Error(\`Unknown email locale: \${String(locale)}\`)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const data = (input.data ?? {}) as Record<string, unknown>
|
|
181
|
-
const appName =
|
|
182
|
-
(typeof data.appName === 'string' && data.appName) ||
|
|
183
|
-
getNestedValue(EMAIL_THEME as Record<string, unknown>, 'appName')
|
|
184
|
-
|
|
185
|
-
const baseContext = {
|
|
186
|
-
...data,
|
|
187
|
-
locale,
|
|
188
|
-
theme: EMAIL_THEME,
|
|
189
|
-
t: strings,
|
|
190
|
-
appName,
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const subject = renderTemplate(template.subject, baseContext, false).trim()
|
|
194
|
-
|
|
195
|
-
const htmlBody = renderTemplate(
|
|
196
|
-
template.html,
|
|
77
|
+
const { locale, subject, html, text, variables, hash } = renderEmail(
|
|
78
|
+
EMAIL_ASSETS,
|
|
197
79
|
{
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
80
|
+
name: String(input.name),
|
|
81
|
+
locale: input.locale as string | undefined,
|
|
82
|
+
data: (input.data ?? {}) as Record<string, unknown>,
|
|
83
|
+
}
|
|
202
84
|
)
|
|
203
85
|
|
|
204
|
-
const html = EMAIL_PARTIALS.layout
|
|
205
|
-
? renderTemplate(
|
|
206
|
-
EMAIL_PARTIALS.layout,
|
|
207
|
-
{
|
|
208
|
-
...baseContext,
|
|
209
|
-
subject,
|
|
210
|
-
content: htmlBody,
|
|
211
|
-
},
|
|
212
|
-
true
|
|
213
|
-
)
|
|
214
|
-
: htmlBody
|
|
215
|
-
|
|
216
|
-
const text = template.text
|
|
217
|
-
? renderTemplate(
|
|
218
|
-
template.text,
|
|
219
|
-
{
|
|
220
|
-
...baseContext,
|
|
221
|
-
subject,
|
|
222
|
-
},
|
|
223
|
-
false
|
|
224
|
-
).trim()
|
|
225
|
-
: undefined
|
|
226
|
-
const hash = (template.hashes[locale]?.contentHash ??
|
|
227
|
-
'') as RenderedEmail<TName>['hash']
|
|
228
|
-
|
|
229
86
|
return {
|
|
230
87
|
name: input.name,
|
|
231
|
-
locale,
|
|
88
|
+
locale: locale as EmailLocale,
|
|
232
89
|
subject,
|
|
233
90
|
html,
|
|
234
91
|
...(text ? { text } : {}),
|
|
235
|
-
variables
|
|
236
|
-
hash,
|
|
92
|
+
variables,
|
|
93
|
+
hash: hash as RenderedEmail<TName>['hash'],
|
|
237
94
|
}
|
|
238
95
|
}
|
|
239
96
|
`;
|