@pikku/cli 0.12.22 → 0.12.23

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.
Files changed (75) hide show
  1. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  2. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  3. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  4. package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
  5. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  6. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  7. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  8. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  9. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  10. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  11. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  12. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  13. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  14. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  15. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  16. package/dist/.pikku/function/pikku-functions-meta.gen.json +162 -270
  17. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  18. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  19. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  20. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  21. package/dist/.pikku/http/pikku-http-wirings-meta.gen.json +1 -62
  22. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -2
  23. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -2
  24. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  25. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  26. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  27. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  28. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  29. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  30. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  31. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  32. package/dist/.pikku/pikku-types.gen.js +1 -1
  33. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  34. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  35. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  36. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  37. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  38. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  39. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +13 -19
  40. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  41. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  42. package/dist/.pikku/schemas/register.gen.js +7 -25
  43. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  44. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  45. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  46. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  47. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  48. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  49. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  50. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  51. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  52. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  53. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  54. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  55. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  56. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  57. package/dist/bin/pikku-bin.mjs +2 -2
  58. package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +1 -1
  59. package/dist/src/scaffold/rpc-remote.gen.js +1 -1
  60. package/dist/src/utils/serialize-schemas.js +1 -1
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +2 -2
  63. package/skills/pikku-i18n/SKILL.md +15 -6
  64. package/skills/pikku-rtl/SKILL.md +38 -24
  65. package/dist/.pikku/schemas/schemas/GraphStarterInput.schema.json +0 -1
  66. package/dist/.pikku/schemas/schemas/GraphStarterOutput.schema.json +0 -1
  67. package/dist/.pikku/schemas/schemas/WorkflowRunStatus.schema.json +0 -1
  68. package/dist/.pikku/schemas/schemas/WorkflowRunnerInput.schema.json +0 -1
  69. package/dist/.pikku/schemas/schemas/WorkflowStarterInput.schema.json +0 -1
  70. package/dist/.pikku/schemas/schemas/WorkflowStarterOutput.schema.json +0 -1
  71. package/dist/.pikku/schemas/schemas/WorkflowStatusCheckerInput.schema.json +0 -1
  72. package/dist/.pikku/schemas/schemas/WorkflowStatusStreamFullInput.schema.json +0 -1
  73. package/dist/.pikku/schemas/schemas/WorkflowStatusStreamInput.schema.json +0 -1
  74. package/dist/src/scaffold/workflow-routes.gen.d.ts +0 -84
  75. package/dist/src/scaffold/workflow-routes.gen.js +0 -229
@@ -1,229 +0,0 @@
1
- /**
2
- * This file was generated by @pikku/cli@0.12.21
3
- */
4
- /**
5
- * Workflow HTTP catch-all routes
6
- * Do not edit manually - regenerate with 'npx pikku'
7
- */
8
- import { pikkuSessionlessFunc, wireHTTPRoutes } from '../../.pikku/pikku-types.gen.js';
9
- import { MissingServiceError } from '@pikku/core/errors';
10
- function assertWorkflowService(workflowService) {
11
- if (!workflowService)
12
- throw new MissingServiceError('workflowService is required');
13
- }
14
- function assertWorkflowRunService(workflowRunService) {
15
- if (!workflowRunService)
16
- throw new MissingServiceError('workflowRunService is required');
17
- }
18
- export const workflowStarter = pikkuSessionlessFunc({
19
- auth: false,
20
- func: async (_services, { workflowName, data }, { rpc }) => {
21
- return await rpc.startWorkflow(workflowName, (data ?? {}));
22
- },
23
- });
24
- export const workflowRunner = pikkuSessionlessFunc({
25
- auth: false,
26
- func: async ({ workflowService }, { workflowName, data }, { rpc }) => {
27
- assertWorkflowService(workflowService);
28
- return await workflowService.runToCompletion(workflowName, (data ?? {}), rpc);
29
- },
30
- });
31
- export const workflowStatusChecker = pikkuSessionlessFunc({
32
- auth: false,
33
- func: async ({ workflowService }, { runId }) => {
34
- assertWorkflowService(workflowService);
35
- const status = await workflowService.getRunStatus(runId);
36
- if (!status)
37
- throw new Error(`Run not found: ${runId}`);
38
- return status;
39
- },
40
- });
41
- /**
42
- * Minimal workflow status stream — sends step names and statuses only.
43
- * Use this for user-facing frontends where internal details should not be exposed.
44
- */
45
- export const workflowStatusStream = pikkuSessionlessFunc({
46
- auth: false,
47
- func: async ({ workflowRunService }, { runId }, { channel }) => {
48
- assertWorkflowRunService(workflowRunService);
49
- if (!channel)
50
- return;
51
- const terminalStatuses = new Set(['completed', 'failed', 'cancelled']);
52
- let lastHash = '';
53
- let initSent = false;
54
- const poll = async () => {
55
- const run = await workflowRunService.getRun(runId);
56
- if (!run) {
57
- channel.close();
58
- return false;
59
- }
60
- const steps = await workflowRunService.getRunSteps(runId);
61
- if (!initSent && run.deterministic) {
62
- const statusByStep = new Map(steps.map((s) => [
63
- s.stepName,
64
- s.status,
65
- ]));
66
- channel.send({
67
- type: 'init',
68
- deterministic: true,
69
- steps: (run.plannedSteps ?? []).map((s) => ({
70
- stepName: s.stepName,
71
- status: statusByStep.get(s.stepName) ?? 'pending',
72
- })),
73
- });
74
- initSent = true;
75
- }
76
- const hash = JSON.stringify({
77
- s: run.status,
78
- steps: steps.map((s) => [s.stepName, s.status]),
79
- });
80
- if (hash !== lastHash) {
81
- lastHash = hash;
82
- channel.send({
83
- type: 'update',
84
- status: run.status,
85
- steps: steps.map((s) => ({
86
- stepName: s.stepName,
87
- status: s.status,
88
- })),
89
- });
90
- }
91
- if (terminalStatuses.has(run.status)) {
92
- channel.send({ type: 'done' });
93
- channel.close();
94
- return false;
95
- }
96
- return true;
97
- };
98
- const shouldContinue = await poll();
99
- if (!shouldContinue)
100
- return;
101
- await new Promise((resolve) => {
102
- const interval = setInterval(async () => {
103
- const cont = await poll();
104
- if (!cont) {
105
- clearInterval(interval);
106
- resolve();
107
- }
108
- }, 500);
109
- });
110
- },
111
- });
112
- /**
113
- * Full workflow status stream — includes output, error, and child run IDs.
114
- * Use this for admin consoles and internal tooling.
115
- */
116
- export const workflowStatusStreamFull = pikkuSessionlessFunc({
117
- auth: false,
118
- func: async ({ workflowRunService }, { runId }, { channel }) => {
119
- assertWorkflowRunService(workflowRunService);
120
- if (!channel)
121
- return;
122
- const terminalStatuses = new Set(['completed', 'failed', 'cancelled']);
123
- let lastHash = '';
124
- let initSent = false;
125
- const poll = async () => {
126
- const run = await workflowRunService.getRun(runId);
127
- if (!run) {
128
- channel.close();
129
- return false;
130
- }
131
- const steps = await workflowRunService.getRunSteps(runId);
132
- if (!initSent && run.deterministic) {
133
- const statusByStep = new Map(steps.map((s) => [
134
- s.stepName,
135
- s.status,
136
- ]));
137
- channel.send({
138
- type: 'init',
139
- deterministic: true,
140
- steps: (run.plannedSteps ?? []).map((s) => ({
141
- stepName: s.stepName,
142
- status: statusByStep.get(s.stepName) ?? 'pending',
143
- })),
144
- });
145
- initSent = true;
146
- }
147
- const hash = JSON.stringify({
148
- s: run.status,
149
- o: run.output,
150
- steps: steps.map((s) => [s.stepName, s.status]),
151
- });
152
- if (hash !== lastHash) {
153
- lastHash = hash;
154
- channel.send({
155
- type: 'update',
156
- status: run.status,
157
- output: run.output,
158
- error: run.error,
159
- steps: steps.map((s) => ({
160
- stepName: s.stepName,
161
- status: s.status,
162
- ...(s.childRunId ? { childRunId: s.childRunId } : {}),
163
- })),
164
- });
165
- }
166
- if (terminalStatuses.has(run.status)) {
167
- channel.send({ type: 'done' });
168
- channel.close();
169
- return false;
170
- }
171
- return true;
172
- };
173
- const shouldContinue = await poll();
174
- if (!shouldContinue)
175
- return;
176
- await new Promise((resolve) => {
177
- const interval = setInterval(async () => {
178
- const cont = await poll();
179
- if (!cont) {
180
- clearInterval(interval);
181
- resolve();
182
- }
183
- }, 500);
184
- });
185
- },
186
- });
187
- export const graphStarter = pikkuSessionlessFunc({
188
- auth: false,
189
- func: async (_services, { workflowName, nodeId, data }, { rpc }) => {
190
- return await rpc.startWorkflow(workflowName, (data ?? {}), { startNode: nodeId });
191
- },
192
- });
193
- wireHTTPRoutes({
194
- auth: false,
195
- routes: {
196
- workflowStart: {
197
- route: '/workflow/:workflowName/start',
198
- method: 'post',
199
- func: workflowStarter,
200
- },
201
- workflowRun: {
202
- route: '/workflow/:workflowName/run',
203
- method: 'post',
204
- func: workflowRunner,
205
- },
206
- workflowStatus: {
207
- route: '/workflow/:workflowName/status/:runId',
208
- method: 'get',
209
- func: workflowStatusChecker,
210
- },
211
- workflowStatusStream: {
212
- route: '/workflow/:workflowName/status/:runId/stream',
213
- method: 'get',
214
- sse: true,
215
- func: workflowStatusStream,
216
- },
217
- workflowStatusStreamFull: {
218
- route: '/workflow/:workflowName/status/:runId/stream/full',
219
- method: 'get',
220
- sse: true,
221
- func: workflowStatusStreamFull,
222
- },
223
- graphStart: {
224
- route: '/workflow/:workflowName/graph/:nodeId',
225
- method: 'post',
226
- func: graphStarter,
227
- },
228
- },
229
- });