@pipefy/pipefy-process-coder 0.1.0 → 0.1.2

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 (162) hide show
  1. package/.agents/skills/ppc-pipefy-flow-authoring/SKILL.md +262 -262
  2. package/.agents/skills/ppc-pipefy-flow-authoring/examples/01-main-2-danfe-consulta.json +247 -247
  3. package/.agents/skills/ppc-pipefy-flow-authoring/examples/01-main-2-webhook-retorno-consulta.json +589 -589
  4. package/.agents/skills/ppc-pipefy-flow-authoring/examples/01-main-4-recebimento-barramento.json +1391 -1391
  5. package/.agents/skills/ppc-pipefy-flow-authoring/examples/02-subflow-2-danfe-retorno.json +623 -623
  6. package/.agents/skills/ppc-pipefy-flow-authoring/examples/02-subflow-4-criacao-operacao.json +636 -636
  7. package/.agents/skills/ppc-pipefy-flow-authoring/examples/03-subflow-4-criacao-titulo.json +3642 -3642
  8. package/.agents/skills/ppc-pipefy-flow-authoring/examples/04-subflow-4-criacao-cedente.json +863 -863
  9. package/.agents/skills/ppc-pipefy-flow-authoring/examples/04-subflow-4-criacao-sacado.json +799 -799
  10. package/.agents/skills/ppc-pipefy-flow-authoring/examples/README.md +42 -42
  11. package/.agents/skills/ppc-pipefy-flow-authoring/examples/hml-01-subflow-1-titulo-acompanhamento-cobranca.json +581 -581
  12. package/.agents/skills/ppc-pipefy-flow-authoring/examples/hml-01-subflow-1-titulo-nfe-monitoramento.json +503 -503
  13. package/.agents/skills/ppc-pipefy-flow-authoring/examples/hml-01-subflow-1-titulo-retorno-bancario.json +562 -562
  14. package/.agents/skills/ppc-pipefy-flow-authoring/examples/hml-02-subflow-2-retorno-consulta-cedente.json +557 -557
  15. package/.agents/skills/ppc-pipefy-flow-authoring/examples/hml-02-subflow-2-retorno-consulta-sacado.json +609 -609
  16. package/.agents/skills/ppc-pipefy-pipe-authoring/SKILL.md +146 -146
  17. package/.agents/skills/ppc-pipefy-process-design/SKILL.md +127 -127
  18. package/.agents/skills/ppc-pipefy-workspace/SKILL.md +91 -91
  19. package/AGENTS.md +476 -456
  20. package/LICENSE +202 -0
  21. package/NOTICE +11 -0
  22. package/README.md +830 -808
  23. package/bin/pipe.js +25 -4
  24. package/dist/apply/adopt.js +128 -0
  25. package/dist/apply/agentops.js +42 -0
  26. package/dist/apply/compile.js +722 -0
  27. package/dist/apply/execute.js +277 -0
  28. package/dist/apply/flowops.js +293 -0
  29. package/dist/apply/idmap.js +233 -0
  30. package/dist/apply/mutations.js +704 -0
  31. package/dist/apply/registry.js +348 -0
  32. package/dist/apply/types.js +18 -0
  33. package/dist/cli/args.js +79 -0
  34. package/dist/cli.js +196 -0
  35. package/dist/codec/flow.js +164 -0
  36. package/dist/codec/pack.js +88 -0
  37. package/dist/codec/roundtrip.js +86 -0
  38. package/dist/codec/unpack.js +181 -0
  39. package/dist/commands/agents.js +145 -0
  40. package/dist/commands/apply.js +982 -0
  41. package/dist/commands/context.js +79 -0
  42. package/dist/commands/create.js +63 -0
  43. package/dist/commands/diff.js +294 -0
  44. package/dist/commands/flows.js +348 -0
  45. package/dist/commands/misc.js +562 -0
  46. package/dist/commands/plan.js +301 -0
  47. package/dist/commands/pull.js +549 -0
  48. package/dist/commands/runs.js +74 -0
  49. package/dist/commands/skills.js +131 -0
  50. package/dist/commands/verify.js +205 -0
  51. package/dist/config.js +125 -0
  52. package/dist/diff/agents.js +80 -0
  53. package/dist/diff/diff.js +983 -0
  54. package/dist/diff/flow.js +258 -0
  55. package/{src/diff/html.ts → dist/diff/html.js} +274 -322
  56. package/dist/diff/render.js +90 -0
  57. package/dist/model/payload.js +84 -0
  58. package/dist/model/tree.js +7 -0
  59. package/dist/model/volatile.js +54 -0
  60. package/dist/pipefy/agents.js +131 -0
  61. package/dist/pipefy/automations.js +155 -0
  62. package/dist/pipefy/capability.js +84 -0
  63. package/dist/pipefy/client.js +204 -0
  64. package/dist/pipefy/discovery.js +148 -0
  65. package/dist/pipefy/internal.js +406 -0
  66. package/dist/pipefy/ipaas.js +269 -0
  67. package/dist/pipefy/reconstruct.js +676 -0
  68. package/dist/pipefy/reference.js +172 -0
  69. package/dist/pipefy/snapshot.js +185 -0
  70. package/dist/pipefy/toolkit.js +174 -0
  71. package/{src → dist}/pipefy/toolkit_bearer.py +60 -14
  72. package/dist/report/integrations.js +165 -0
  73. package/dist/report/run.js +356 -0
  74. package/dist/util/fsx.js +50 -0
  75. package/dist/util/git.js +25 -0
  76. package/dist/util/json.js +56 -0
  77. package/dist/util/log.js +69 -0
  78. package/dist/util/pool.js +42 -0
  79. package/dist/util/slug.js +23 -0
  80. package/dist/util/tui.js +287 -0
  81. package/dist/validate/index.js +86 -0
  82. package/dist/validate/integrity.js +370 -0
  83. package/dist/validate/reference.js +120 -0
  84. package/dist/validate/schema.js +278 -0
  85. package/dist/version.js +18 -0
  86. package/dist/workspace/agents.js +245 -0
  87. package/{src/workspace/docs.ts → dist/workspace/docs.js} +367 -407
  88. package/dist/workspace/flows.js +149 -0
  89. package/dist/workspace/layout.js +146 -0
  90. package/dist/workspace/lock.js +83 -0
  91. package/dist/workspace/read.js +168 -0
  92. package/dist/workspace/reference.js +24 -0
  93. package/dist/workspace/stamp.js +234 -0
  94. package/dist/workspace/write.js +194 -0
  95. package/package.json +38 -35
  96. package/src/apply/adopt.ts +0 -150
  97. package/src/apply/agentops.ts +0 -71
  98. package/src/apply/compile.ts +0 -875
  99. package/src/apply/execute.ts +0 -336
  100. package/src/apply/flowops.ts +0 -399
  101. package/src/apply/idmap.ts +0 -241
  102. package/src/apply/mutations.ts +0 -955
  103. package/src/apply/registry.ts +0 -430
  104. package/src/apply/types.ts +0 -134
  105. package/src/cli/args.ts +0 -88
  106. package/src/cli.ts +0 -211
  107. package/src/codec/flow.ts +0 -199
  108. package/src/codec/pack.ts +0 -103
  109. package/src/codec/roundtrip.ts +0 -94
  110. package/src/codec/unpack.ts +0 -198
  111. package/src/commands/agents.ts +0 -184
  112. package/src/commands/apply.ts +0 -1144
  113. package/src/commands/context.ts +0 -119
  114. package/src/commands/create.ts +0 -79
  115. package/src/commands/diff.ts +0 -314
  116. package/src/commands/flows.ts +0 -414
  117. package/src/commands/misc.ts +0 -644
  118. package/src/commands/plan.ts +0 -331
  119. package/src/commands/pull.ts +0 -567
  120. package/src/commands/runs.ts +0 -83
  121. package/src/commands/skills.ts +0 -137
  122. package/src/commands/verify.ts +0 -253
  123. package/src/config.ts +0 -168
  124. package/src/diff/agents.ts +0 -122
  125. package/src/diff/diff.ts +0 -1130
  126. package/src/diff/flow.ts +0 -318
  127. package/src/diff/render.ts +0 -101
  128. package/src/model/payload.ts +0 -154
  129. package/src/model/tree.ts +0 -99
  130. package/src/model/volatile.ts +0 -55
  131. package/src/pipefy/agents.ts +0 -165
  132. package/src/pipefy/automations.ts +0 -219
  133. package/src/pipefy/capability.ts +0 -119
  134. package/src/pipefy/client.ts +0 -267
  135. package/src/pipefy/discovery.ts +0 -209
  136. package/src/pipefy/internal.ts +0 -380
  137. package/src/pipefy/ipaas.ts +0 -365
  138. package/src/pipefy/reconstruct.ts +0 -775
  139. package/src/pipefy/reference.ts +0 -251
  140. package/src/pipefy/snapshot.ts +0 -245
  141. package/src/pipefy/toolkit.ts +0 -200
  142. package/src/report/integrations.ts +0 -231
  143. package/src/report/run.ts +0 -475
  144. package/src/util/fsx.ts +0 -45
  145. package/src/util/git.ts +0 -32
  146. package/src/util/json.ts +0 -55
  147. package/src/util/log.ts +0 -76
  148. package/src/util/pool.ts +0 -48
  149. package/src/util/slug.ts +0 -26
  150. package/src/util/tui.ts +0 -335
  151. package/src/validate/index.ts +0 -123
  152. package/src/validate/integrity.ts +0 -387
  153. package/src/validate/reference.ts +0 -136
  154. package/src/validate/schema.ts +0 -328
  155. package/src/workspace/agents.ts +0 -290
  156. package/src/workspace/flows.ts +0 -191
  157. package/src/workspace/layout.ts +0 -165
  158. package/src/workspace/lock.ts +0 -148
  159. package/src/workspace/read.ts +0 -165
  160. package/src/workspace/reference.ts +0 -24
  161. package/src/workspace/stamp.ts +0 -301
  162. package/src/workspace/write.ts +0 -225
@@ -1,91 +1,91 @@
1
- ---
2
- name: ppc-pipefy-workspace
3
- description: Use when working in a pipefy-process-coder workspace — pulling a Pipefy pipe to disk, editing its JSON, diffing, planning and applying changes back. Covers the loop, which command to run when, what each generated doc is for, and the safety rules that make an apply trustworthy. Start here before editing anything.
4
- ---
5
-
6
- # Working in a Pipefy workspace
7
-
8
- A workspace is a Pipefy pipe pulled to disk as JSON. You edit the files; the tool
9
- turns your edits into API calls. Nothing about a pipe is edited through this tool
10
- except by changing a file and applying it.
11
-
12
- ## The loop, and why each step exists
13
-
14
- ```bash
15
- pipe pull <pipeId> --out ./my-pipe # the pipe AND its iPaaS flows
16
- cd my-pipe
17
- # edit the JSON
18
- pipe validate # shape + referential integrity. Offline, instant.
19
- pipe diff # what you changed — pipe structure and flows
20
- pipe plan --dry-run # is every change applicable? refuses if not
21
- pipe apply # snapshot, apply step by step, verify, adopt
22
- ```
23
-
24
- **One loop covers both halves of a process.** A pipe's iPaaS flows are entities of
25
- that pipe — its own webhook URLs carry their ids — so they are pulled, diffed,
26
- planned and applied by the same commands, and land under
27
- `pipes/<id>--<name>/flows/`. `--no-flows` opts out of the flow half.
28
-
29
- **`pipe validate && pipe plan --dry-run` must both be clean before you propose an
30
- apply.** Both are free — validate needs no network, plan sends no writes — so
31
- iterate against them yourself rather than asking the user to run an apply and see.
32
-
33
- `pipe apply` does four things in order: snapshots the pipe as a rollback point,
34
- executes step by step persisting each status so a failure is resumable, reads the
35
- pipe back and diffs it against your intent, then adopts the result into the files
36
- so server-assigned ids are real. If it half-succeeds, read the output — it tells
37
- you whether to `--resume` or re-plan.
38
-
39
- ## Read these first, in this order
40
-
41
- Every workspace generates three docs. They are not filler.
42
-
43
- | | |
44
- | --- | --- |
45
- | `AGENTS.md` | the editing rules for *this* workspace, including what its read path could and could not see |
46
- | `MAPPING.md` | every field id → label, slug, type and phase. **You need this constantly**, because automations and conditions reference fields by bare numeric id |
47
- | `CAPABILITIES.md` | what this endpoint can actually write, and the reason for every gap |
48
- | `REFERENCE.md` | what the API accepts wherever a value comes from a fixed list — automation event and action parameters, field `type_id`, colours. **Read it before writing an automation**: those lists are published by the schema and enforced by nothing, so a wrong value is only ever reported as `is invalid` |
49
-
50
- `pipe capabilities` prints the same registry with reasons. When a change is
51
- refused, that is where the answer is.
52
-
53
- ## The rules that are not style preferences
54
-
55
- - **`id` is server-owned.** Never invent one, never edit one, never reuse one.
56
- - **A new entity is `"id": null` plus `"_new": true`.** For phases, fields,
57
- automations and labels — the only four arrays with one — also add a fresh v4
58
- `uuid`. Everything else is identified by its owner.
59
- - **To delete, remove the object or the file.** Never a tombstone.
60
- - **`_`-prefixed keys are tool metadata.** Leave them alone.
61
- - **Never edit under `_readonly/` or `_non-snapshot/`.** No write path exists;
62
- plan refuses them by path alone.
63
-
64
- ## Coverage: absence is not always absence
65
-
66
- Every entity group carries `complete`, `partial` or `unknown` coverage in
67
- `_meta.json`. An `unknown` group means the read path could not see it — not that
68
- the pipe has none. Such a group is never diffed and never applied.
69
-
70
- This matters most on a reconstructed pull (no snapshots): webhooks or automations
71
- may be `unknown`, and adding to a list you cannot fully see risks duplicating what
72
- is already there. Check `_meta.json` before concluding a pipe lacks something.
73
-
74
- ## Where to go next
75
-
76
- | Task | Skill |
77
- | --- | --- |
78
- | Editing phases, fields, automations, conditions, labels | `ppc-pipefy-pipe-authoring` |
79
- | Editing or building an iPaaS (Advanced Automations) flow | `ppc-pipefy-flow-authoring` |
80
- | Deciding *which* Pipefy mechanism a requirement needs | `ppc-pipefy-process-design` |
81
-
82
- ## Two habits worth keeping
83
-
84
- **Diff before you explain.** `pipe diff` on a real change costs ~150 tokens and
85
- tells you exactly what you altered. Reading the whole pipe back to check your work
86
- costs 50× that and is less reliable.
87
-
88
- **Believe the refusal.** When `pipe plan` says a change has no write path, it is
89
- because the mutation genuinely lacks that input — the registry records the reason
90
- per column. Do not route around it with a delete and a create; that destroys data.
91
- Say so plainly and stop.
1
+ ---
2
+ name: ppc-pipefy-workspace
3
+ description: Use when working in a pipefy-process-coder workspace — pulling a Pipefy pipe to disk, editing its JSON, diffing, planning and applying changes back. Covers the loop, which command to run when, what each generated doc is for, and the safety rules that make an apply trustworthy. Start here before editing anything.
4
+ ---
5
+
6
+ # Working in a Pipefy workspace
7
+
8
+ A workspace is a Pipefy pipe pulled to disk as JSON. You edit the files; the tool
9
+ turns your edits into API calls. Nothing about a pipe is edited through this tool
10
+ except by changing a file and applying it.
11
+
12
+ ## The loop, and why each step exists
13
+
14
+ ```bash
15
+ pipe pull <pipeId> --out ./my-pipe # the pipe AND its iPaaS flows
16
+ cd my-pipe
17
+ # edit the JSON
18
+ pipe validate # shape + referential integrity. Offline, instant.
19
+ pipe diff # what you changed — pipe structure and flows
20
+ pipe plan --dry-run # is every change applicable? refuses if not
21
+ pipe apply # snapshot, apply step by step, verify, adopt
22
+ ```
23
+
24
+ **One loop covers both halves of a process.** A pipe's iPaaS flows are entities of
25
+ that pipe — its own webhook URLs carry their ids — so they are pulled, diffed,
26
+ planned and applied by the same commands, and land under
27
+ `pipes/<id>--<name>/flows/`. `--no-flows` opts out of the flow half.
28
+
29
+ **`pipe validate && pipe plan --dry-run` must both be clean before you propose an
30
+ apply.** Both are free — validate needs no network, plan sends no writes — so
31
+ iterate against them yourself rather than asking the user to run an apply and see.
32
+
33
+ `pipe apply` does four things in order: snapshots the pipe as a rollback point,
34
+ executes step by step persisting each status so a failure is resumable, reads the
35
+ pipe back and diffs it against your intent, then adopts the result into the files
36
+ so server-assigned ids are real. If it half-succeeds, read the output — it tells
37
+ you whether to `--resume` or re-plan.
38
+
39
+ ## Read these first, in this order
40
+
41
+ Every workspace generates three docs. They are not filler.
42
+
43
+ | | |
44
+ | --- | --- |
45
+ | `AGENTS.md` | the editing rules for *this* workspace, including what its read path could and could not see |
46
+ | `MAPPING.md` | every field id → label, slug, type and phase. **You need this constantly**, because automations and conditions reference fields by bare numeric id |
47
+ | `CAPABILITIES.md` | what this endpoint can actually write, and the reason for every gap |
48
+ | `REFERENCE.md` | what the API accepts wherever a value comes from a fixed list — automation event and action parameters, field `type_id`, colours. **Read it before writing an automation**: those lists are published by the schema and enforced by nothing, so a wrong value is only ever reported as `is invalid` |
49
+
50
+ `pipe capabilities` prints the same registry with reasons. When a change is
51
+ refused, that is where the answer is.
52
+
53
+ ## The rules that are not style preferences
54
+
55
+ - **`id` is server-owned.** Never invent one, never edit one, never reuse one.
56
+ - **A new entity is `"id": null` plus `"_new": true`.** For phases, fields,
57
+ automations and labels — the only four arrays with one — also add a fresh v4
58
+ `uuid`. Everything else is identified by its owner.
59
+ - **To delete, remove the object or the file.** Never a tombstone.
60
+ - **`_`-prefixed keys are tool metadata.** Leave them alone.
61
+ - **Never edit under `_readonly/` or `_non-snapshot/`.** No write path exists;
62
+ plan refuses them by path alone.
63
+
64
+ ## Coverage: absence is not always absence
65
+
66
+ Every entity group carries `complete`, `partial` or `unknown` coverage in
67
+ `_meta.json`. An `unknown` group means the read path could not see it — not that
68
+ the pipe has none. Such a group is never diffed and never applied.
69
+
70
+ This matters most on a reconstructed pull (no snapshots): webhooks or automations
71
+ may be `unknown`, and adding to a list you cannot fully see risks duplicating what
72
+ is already there. Check `_meta.json` before concluding a pipe lacks something.
73
+
74
+ ## Where to go next
75
+
76
+ | Task | Skill |
77
+ | --- | --- |
78
+ | Editing phases, fields, automations, conditions, labels | `ppc-pipefy-pipe-authoring` |
79
+ | Editing or building an iPaaS (Advanced Automations) flow | `ppc-pipefy-flow-authoring` |
80
+ | Deciding *which* Pipefy mechanism a requirement needs | `ppc-pipefy-process-design` |
81
+
82
+ ## Two habits worth keeping
83
+
84
+ **Diff before you explain.** `pipe diff` on a real change costs ~150 tokens and
85
+ tells you exactly what you altered. Reading the whole pipe back to check your work
86
+ costs 50× that and is less reliable.
87
+
88
+ **Believe the refusal.** When `pipe plan` says a change has no write path, it is
89
+ because the mutation genuinely lacks that input — the registry records the reason
90
+ per column. Do not route around it with a delete and a create; that destroys data.
91
+ Say so plainly and stop.