@pikku/cli 0.12.151 → 0.12.152

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 (138) hide show
  1. package/dist/.pikku/addon/index.d.ts +1 -1
  2. package/dist/.pikku/addon/index.js +1 -1
  3. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  4. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  5. package/dist/.pikku/agent/index.d.ts +1 -1
  6. package/dist/.pikku/agent/index.js +1 -1
  7. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  8. package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
  9. package/dist/.pikku/analytics/index.d.ts +1 -1
  10. package/dist/.pikku/analytics/index.js +1 -1
  11. package/dist/.pikku/analytics/pikku-analytics-types.gen.d.ts +1 -1
  12. package/dist/.pikku/analytics/pikku-analytics-types.gen.js +1 -1
  13. package/dist/.pikku/auth/index.d.ts +1 -1
  14. package/dist/.pikku/auth/index.js +1 -1
  15. package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
  16. package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
  17. package/dist/.pikku/channel/index.d.ts +1 -1
  18. package/dist/.pikku/channel/index.js +1 -1
  19. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  20. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  21. package/dist/.pikku/cli/index.d.ts +1 -1
  22. package/dist/.pikku/cli/index.js +1 -1
  23. package/dist/.pikku/cli/pikku-cli-channel.js +6 -1
  24. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  25. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  26. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  27. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  28. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.json +38 -1
  29. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  30. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  31. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  32. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +38 -1
  33. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  34. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  35. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  36. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  37. package/dist/.pikku/error/index.d.ts +1 -1
  38. package/dist/.pikku/error/index.js +1 -1
  39. package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
  40. package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
  41. package/dist/.pikku/function/index.d.ts +1 -1
  42. package/dist/.pikku/function/index.js +1 -1
  43. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  44. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  45. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  46. package/dist/.pikku/function/pikku-functions-meta.gen.json +19 -0
  47. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  48. package/dist/.pikku/gateway/index.d.ts +1 -1
  49. package/dist/.pikku/gateway/index.js +1 -1
  50. package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
  51. package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
  52. package/dist/.pikku/http/index.d.ts +1 -1
  53. package/dist/.pikku/http/index.js +1 -1
  54. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  55. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  56. package/dist/.pikku/mcp/index.d.ts +1 -1
  57. package/dist/.pikku/mcp/index.js +1 -1
  58. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  59. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  60. package/dist/.pikku/middleware/index.d.ts +1 -1
  61. package/dist/.pikku/middleware/index.js +1 -1
  62. package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
  63. package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
  64. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  65. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  66. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  67. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  68. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  69. package/dist/.pikku/queue/index.d.ts +1 -1
  70. package/dist/.pikku/queue/index.js +1 -1
  71. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  72. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  73. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  74. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  75. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  76. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  77. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +1 -0
  78. package/dist/.pikku/scenarios/index.d.ts +1 -1
  79. package/dist/.pikku/scenarios/index.js +1 -1
  80. package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
  81. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  82. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  83. package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
  84. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  85. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  86. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  87. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  88. package/dist/.pikku/scheduler/index.d.ts +1 -1
  89. package/dist/.pikku/scheduler/index.js +1 -1
  90. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  91. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  92. package/dist/.pikku/schemas/register.gen.js +5 -1
  93. package/dist/.pikku/schemas/schemas/FabricChangesFileInput.schema.json +1 -0
  94. package/dist/.pikku/schemas/schemas/FabricChangesFileOutput.schema.json +1 -0
  95. package/dist/.pikku/scopes/index.d.ts +1 -1
  96. package/dist/.pikku/scopes/index.js +1 -1
  97. package/dist/.pikku/scopes/pikku-flags.gen.d.ts +1 -1
  98. package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
  99. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
  100. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
  101. package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
  102. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  103. package/dist/.pikku/secrets/index.d.ts +1 -1
  104. package/dist/.pikku/secrets/index.js +1 -1
  105. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  106. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  107. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  108. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  109. package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
  110. package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
  111. package/dist/.pikku/setup/index.d.ts +1 -1
  112. package/dist/.pikku/setup/index.js +1 -1
  113. package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
  114. package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
  115. package/dist/.pikku/trigger/index.d.ts +1 -1
  116. package/dist/.pikku/trigger/index.js +1 -1
  117. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  118. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  119. package/dist/.pikku/variables/index.d.ts +1 -1
  120. package/dist/.pikku/variables/index.js +1 -1
  121. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  122. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  123. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  124. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  125. package/dist/.pikku/workflow/index.d.ts +1 -1
  126. package/dist/.pikku/workflow/index.js +1 -1
  127. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  128. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  129. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  130. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  131. package/dist/bin/pikku-bin.mjs +2 -2
  132. package/dist/src/fabric/fabric-commands.d.ts +37 -0
  133. package/dist/src/fabric/fabric-commands.js +32 -1
  134. package/dist/src/fabric/functions/changes-file.function.d.ts +64 -0
  135. package/dist/src/fabric/functions/changes-file.function.js +56 -0
  136. package/dist/tsconfig.tsbuildinfo +1 -1
  137. package/package.json +1 -1
  138. package/surface.json +1 -1
@@ -45,6 +45,7 @@ import { FabricDomainsRemove } from './functions/domains-remove.function.js';
45
45
  import { FabricLLMKey, renderLLMKey } from './functions/llm-key.function.js';
46
46
  import { FabricChangesList, renderChangesList, } from './functions/changes-list.function.js';
47
47
  import { FabricChangesShow, renderChangesShow, } from './functions/changes-show.function.js';
48
+ import { FabricChangesFile, renderChangesFile, } from './functions/changes-file.function.js';
48
49
  import { FabricChangesClaim, renderChangesClaim, } from './functions/changes-claim.function.js';
49
50
  import { FabricChangesAsk, renderChangesAsk, } from './functions/changes-ask.function.js';
50
51
  import { FabricChangesShot, renderChangesShot, } from './functions/changes-shot.function.js';
@@ -482,7 +483,7 @@ export const fabricCommands = defineCLICommands({
482
483
  },
483
484
  },
484
485
  changes: {
485
- description: 'The todo list filed from inside a deployed stage: read what is open, claim a batch, ask what you need to know, and tick items off',
486
+ description: 'The todo list filed from inside a deployed stage: read what is open, file what was decided elsewhere, claim a batch, ask what you need to know, and tick items off',
486
487
  subcommands: {
487
488
  list: pikkuCLICommand({
488
489
  func: FabricChangesList,
@@ -524,6 +525,36 @@ export const fabricCommands = defineCLICommands({
524
525
  apiUrl: { description: 'Override the fabric-api URL for this call' },
525
526
  },
526
527
  }),
528
+ file: pikkuCLICommand({
529
+ func: FabricChangesFile,
530
+ render: renderChangesFile,
531
+ description: 'File an item from outside the panel — the words, without the screenshot the panel would have attached',
532
+ options: {
533
+ projectId: {
534
+ description: 'Project to file against (defaults to the linked checkout)',
535
+ short: 'p',
536
+ },
537
+ stageId: {
538
+ description: 'Stage to file against (defaults to the only stage)',
539
+ },
540
+ branch: {
541
+ description: 'Resolve the stage from this branch instead',
542
+ },
543
+ title: {
544
+ description: 'The requirement, in one line',
545
+ short: 't',
546
+ },
547
+ body: { description: 'The detail, if a line is not enough' },
548
+ bodyFile: {
549
+ description: 'Read the body from a file — use this when it has newlines',
550
+ },
551
+ route: {
552
+ description: 'The route it is about, e.g. /admin/rota',
553
+ },
554
+ locale: { description: 'Locale it was seen in, e.g. de' },
555
+ apiUrl: { description: 'Override the fabric-api URL for this call' },
556
+ },
557
+ }),
527
558
  claim: pikkuCLICommand({
528
559
  func: FabricChangesClaim,
529
560
  render: renderChangesClaim,
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+ import type { CreateChangeOutput } from '../sdk/rpc-map.gen.d.js';
3
+ export declare const FabricChangesFileInput: z.ZodObject<{
4
+ apiUrl: z.ZodOptional<z.ZodString>;
5
+ projectId: z.ZodOptional<z.ZodString>;
6
+ stageId: z.ZodOptional<z.ZodString>;
7
+ branch: z.ZodOptional<z.ZodString>;
8
+ title: z.ZodString;
9
+ body: z.ZodOptional<z.ZodString>;
10
+ bodyFile: z.ZodOptional<z.ZodString>;
11
+ route: z.ZodOptional<z.ZodString>;
12
+ locale: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export declare const FabricChangesFileOutput: z.ZodObject<{
15
+ change: z.ZodAny;
16
+ }, z.core.$strip>;
17
+ /**
18
+ * An item filed from a terminal carries no screenshot, no circled elements and
19
+ * no build — the panel supplies those and nothing here can invent them. What it
20
+ * does carry is the words, which the skill already treats as the requirement
21
+ * and every other address as evidence, so a written item is a thinner but not a
22
+ * malformed one.
23
+ *
24
+ * `--body-file` because a real item's body is a paragraph with newlines in it,
25
+ * and putting that through shell quoting is where it gets mangled.
26
+ */
27
+ export declare const FabricChangesFile: import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionConfig<{
28
+ apiUrl?: string | undefined;
29
+ projectId?: string | undefined;
30
+ stageId?: string | undefined;
31
+ branch?: string | undefined;
32
+ title: string;
33
+ body?: string | undefined;
34
+ bodyFile?: string | undefined;
35
+ route?: string | undefined;
36
+ locale?: string | undefined;
37
+ }, {
38
+ change: any;
39
+ }, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunction<{
40
+ apiUrl?: string | undefined;
41
+ projectId?: string | undefined;
42
+ stageId?: string | undefined;
43
+ branch?: string | undefined;
44
+ title: string;
45
+ body?: string | undefined;
46
+ bodyFile?: string | undefined;
47
+ route?: string | undefined;
48
+ locale?: string | undefined;
49
+ }, {
50
+ change: any;
51
+ }, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices> | import("../../../.pikku/function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
52
+ apiUrl?: string | undefined;
53
+ projectId?: string | undefined;
54
+ stageId?: string | undefined;
55
+ branch?: string | undefined;
56
+ title: string;
57
+ body?: string | undefined;
58
+ bodyFile?: string | undefined;
59
+ route?: string | undefined;
60
+ locale?: string | undefined;
61
+ }, {
62
+ change: any;
63
+ }, "rpc" | "session", import("../../../.pikku/function/pikku-function-types.gen.js").WiredServices, unknown>, undefined, undefined>;
64
+ export declare const renderChangesFile: (_s: unknown, { change }: CreateChangeOutput) => void;
@@ -0,0 +1,56 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { z } from 'zod';
3
+ import { pikkuSessionlessFunc } from '../../../.pikku/function/index.js';
4
+ import { changesContext, requireProjectId } from '../lib/changes.js';
5
+ import { resolveStageId } from '../lib/stage.js';
6
+ import { dim, safe } from '../lib/output.js';
7
+ export const FabricChangesFileInput = z.object({
8
+ apiUrl: z.string().optional(),
9
+ projectId: z.string().optional(),
10
+ stageId: z.string().optional(),
11
+ branch: z.string().optional(),
12
+ title: z.string().trim().min(1, 'Give the item a title.'),
13
+ body: z.string().optional(),
14
+ bodyFile: z.string().optional(),
15
+ route: z.string().optional(),
16
+ locale: z.string().optional(),
17
+ });
18
+ export const FabricChangesFileOutput = z.object({
19
+ change: z.any(),
20
+ });
21
+ /**
22
+ * An item filed from a terminal carries no screenshot, no circled elements and
23
+ * no build — the panel supplies those and nothing here can invent them. What it
24
+ * does carry is the words, which the skill already treats as the requirement
25
+ * and every other address as evidence, so a written item is a thinner but not a
26
+ * malformed one.
27
+ *
28
+ * `--body-file` because a real item's body is a paragraph with newlines in it,
29
+ * and putting that through shell quoting is where it gets mangled.
30
+ */
31
+ export const FabricChangesFile = pikkuSessionlessFunc({
32
+ description: 'File a change against a stage from outside the panel.',
33
+ input: FabricChangesFileInput,
34
+ output: FabricChangesFileOutput,
35
+ func: async (_services, input) => {
36
+ if (input.body && input.bodyFile)
37
+ throw new Error('Pass --body or --body-file, not both.');
38
+ const { rpc, projectId } = await changesContext(input.apiUrl, input.projectId);
39
+ const stageId = input.stageId ??
40
+ (await resolveStageId(rpc, requireProjectId(projectId), input.branch));
41
+ const body = input.bodyFile
42
+ ? await readFile(input.bodyFile, 'utf8')
43
+ : input.body;
44
+ return await rpc.invoke('createChange', {
45
+ stageId,
46
+ title: input.title,
47
+ body: body?.trim() || undefined,
48
+ route: input.route,
49
+ locale: input.locale,
50
+ });
51
+ },
52
+ });
53
+ export const renderChangesFile = (_s, { change }) => {
54
+ console.log(`Filed #${safe(change.shortId)} ${safe(change.title)}`);
55
+ console.log(dim(` ${safe(change.changeId)}`));
56
+ };