stageflow 0.35.0 → 0.36.0

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 (94) hide show
  1. package/dist/agent/claudeAdapter.js +6 -0
  2. package/dist/agent/piAdapter.js +9 -0
  3. package/dist/agent/port.d.ts +2 -0
  4. package/dist/channels/config.d.ts +11 -0
  5. package/dist/channels/config.js +95 -0
  6. package/dist/channels/configWriter.d.ts +40 -0
  7. package/dist/channels/configWriter.js +148 -0
  8. package/dist/channels/connectionEdits.d.ts +34 -0
  9. package/dist/channels/connectionEdits.js +53 -0
  10. package/dist/channels/errorInfo.d.ts +18 -0
  11. package/dist/channels/errorInfo.js +71 -0
  12. package/dist/channels/errors.d.ts +12 -0
  13. package/dist/channels/errors.js +13 -0
  14. package/dist/channels/health.d.ts +41 -0
  15. package/dist/channels/health.js +99 -0
  16. package/dist/channels/host.d.ts +55 -0
  17. package/dist/channels/host.js +185 -0
  18. package/dist/channels/http.d.ts +31 -0
  19. package/dist/channels/http.js +79 -0
  20. package/dist/channels/index.d.ts +10 -0
  21. package/dist/channels/index.js +9 -0
  22. package/dist/channels/ledger.d.ts +37 -0
  23. package/dist/channels/ledger.js +95 -0
  24. package/dist/channels/providers/agentmail.d.ts +26 -0
  25. package/dist/channels/providers/agentmail.js +81 -0
  26. package/dist/channels/providers/kit.d.ts +40 -0
  27. package/dist/channels/providers/kit.js +78 -0
  28. package/dist/channels/providers/photonImessage.d.ts +45 -0
  29. package/dist/channels/providers/photonImessage.js +152 -0
  30. package/dist/channels/providers/photonWhatsapp.d.ts +49 -0
  31. package/dist/channels/providers/photonWhatsapp.js +146 -0
  32. package/dist/channels/providers/slack.d.ts +25 -0
  33. package/dist/channels/providers/slack.js +101 -0
  34. package/dist/channels/providers/telegram.d.ts +21 -0
  35. package/dist/channels/providers/telegram.js +100 -0
  36. package/dist/channels/providers.d.ts +5 -0
  37. package/dist/channels/providers.js +22 -0
  38. package/dist/channels/registry.d.ts +54 -0
  39. package/dist/channels/registry.js +186 -0
  40. package/dist/channels/secretStore.d.ts +21 -0
  41. package/dist/channels/secretStore.js +75 -0
  42. package/dist/channels/secrets.d.ts +15 -0
  43. package/dist/channels/secrets.js +50 -0
  44. package/dist/channels/service.d.ts +54 -0
  45. package/dist/channels/service.js +307 -0
  46. package/dist/channels/stageChannels.d.ts +45 -0
  47. package/dist/channels/stageChannels.js +110 -0
  48. package/dist/channels/types.d.ts +142 -0
  49. package/dist/channels/types.js +1 -0
  50. package/dist/cli/doctorCommand.js +3 -1
  51. package/dist/config/draftPackage.d.ts +1 -0
  52. package/dist/config/draftPackage.js +4 -0
  53. package/dist/config/hostConfig.js +1 -0
  54. package/dist/config/loadPipeline.js +27 -3
  55. package/dist/config/loadStage.js +15 -0
  56. package/dist/config/mergePipelineIncludes.d.ts +3 -0
  57. package/dist/config/mergePipelineIncludes.js +27 -0
  58. package/dist/config/pipelineStageKeys.js +1 -0
  59. package/dist/config/validateCatalog.d.ts +4 -1
  60. package/dist/config/validateCatalog.js +23 -0
  61. package/dist/errors/codes.d.ts +1 -1
  62. package/dist/errors/codes.js +1 -0
  63. package/dist/mcp/catalogTools.js +1 -0
  64. package/dist/package-meta.d.ts +1 -1
  65. package/dist/package-meta.js +1 -1
  66. package/dist/preflight/channelChecks.d.ts +17 -0
  67. package/dist/preflight/channelChecks.js +106 -0
  68. package/dist/preflight/pipelinePreflight.d.ts +9 -2
  69. package/dist/preflight/pipelinePreflight.js +9 -1
  70. package/dist/runtime/pipelineRunner.js +3 -1
  71. package/dist/runtime/repositoryMaterialize.d.ts +1 -1
  72. package/dist/runtime/runManager.js +4 -1
  73. package/dist/runtime/stageAttemptBootstrap.js +16 -0
  74. package/dist/runtime/stageProcessLauncher.js +31 -1
  75. package/dist/server/bootstrap.d.ts +3 -0
  76. package/dist/server/bootstrap.js +4 -0
  77. package/dist/server/channelRoutes.d.ts +9 -0
  78. package/dist/server/channelRoutes.js +88 -0
  79. package/dist/server/http.js +11 -0
  80. package/dist/tools/readEmail.d.ts +3 -3
  81. package/dist/tools/sendMessage.d.ts +21 -0
  82. package/dist/tools/sendMessage.js +25 -0
  83. package/dist/types/pipeline.d.ts +4 -1
  84. package/dist/types/stage.d.ts +13 -0
  85. package/dist/ui/assets/index-BOhqnPNg.js +260 -0
  86. package/dist/ui/assets/{index-CIPbbBUi.css → index-Clv4sJpU.css} +1 -1
  87. package/dist/ui/index.html +2 -2
  88. package/examples/channels-smoke/README.md +12 -0
  89. package/examples/channels-smoke/channels-smoke.pipeline.yaml +11 -0
  90. package/examples/channels-smoke/channels-smoke.task.yaml +3 -0
  91. package/examples/channels-smoke/send-email.yaml +32 -0
  92. package/examples/channels-smoke/send-text.yaml +31 -0
  93. package/package.json +8 -3
  94. package/dist/ui/assets/index-BoFPkKFg.js +0 -256
@@ -13,8 +13,8 @@
13
13
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap" />
14
14
  <link rel="icon" type="image/svg+xml" href="/stageflow-icon.svg" />
15
15
  <title>Stageflow</title>
16
- <script type="module" crossorigin src="/assets/index-BoFPkKFg.js"></script>
17
- <link rel="stylesheet" crossorigin href="/assets/index-CIPbbBUi.css">
16
+ <script type="module" crossorigin src="/assets/index-BOhqnPNg.js"></script>
17
+ <link rel="stylesheet" crossorigin href="/assets/index-Clv4sJpU.css">
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
@@ -0,0 +1,12 @@
1
+ # Channels smoke test
2
+
3
+ Two stages, one channel each: `send-email` sends one email (AgentMail) and then `send-text` sends one text (iMessage via Photon), through the connections on the Connections page. A stage can use one channel, so the two are separate stages. Nothing is sent until you start a run.
4
+
5
+ 1. Connect AgentMail and iMessage on the Connections page. The stage expects the connection ids `agentmail` and `imessage`; if yours differ, edit `connection:` in the two stage files.
6
+ 2. Pin your recipients: in `send-email.yaml` replace `to: [change-me@example.invalid]` with your email, and in `send-text.yaml` replace `to: "+10000000000"` with your phone in E.164 form (for example `+14155550123`). On a Free or Pro Photon project the phone must be a project user, and that person must have texted their assigned Photon line once, or the send is rejected.
7
+ 3. Change `model:` to one you have a provider for.
8
+ 4. Run `sf validate` on the pipeline, then open `channels-smoke` in the console and start it with `channels-smoke-task`. The run checks both connections live before the stage starts.
9
+
10
+ The Claude agent backend does not provide `send_message`; use a Pi model (the default).
11
+
12
+ The email subject is `Stageflow channels test`. The agent cannot change recipients, and declaring a second channel on either stage is rejected. A message that may have been sent is never resent: if a call returns `CHANNEL_SEND_OUTCOME_UNKNOWN`, check the provider before running again.
@@ -0,0 +1,11 @@
1
+ id: channels-smoke
2
+ stages:
3
+ - id: send-email
4
+ entry: true
5
+ uses: ./send-email.yaml
6
+ replay_safe: false
7
+ route:
8
+ - to: send-text
9
+ - id: send-text
10
+ uses: ./send-text.yaml
11
+ replay_safe: false
@@ -0,0 +1,3 @@
1
+ id: channels-smoke-task
2
+ goal: Send one test email and one test text message through the connected channels.
3
+ constraints: Send exactly one message per channel. Do not resend an uncertain submission.
@@ -0,0 +1,32 @@
1
+ id: send-email
2
+ # cursor/auto needs CURSOR_API_KEY on the host. Use another model if you prefer.
3
+ model: cursor/auto
4
+ # A stage uses one channel. Pin the recipient here: the agent can only send to it and cannot change it.
5
+ # `connection` is the id shown on the Connections page.
6
+ channels:
7
+ - connection: agentmail
8
+ to: [change-me@example.invalid]
9
+ operations: [send]
10
+ io:
11
+ input:
12
+ schema:
13
+ type: object
14
+ additionalProperties: true
15
+ output:
16
+ schema:
17
+ type: object
18
+ required: [email]
19
+ properties:
20
+ email: { type: string, enum: [sent, failed] }
21
+ additionalProperties: false
22
+ system_prompt: |
23
+ Send one test email, then report the result.
24
+ Call send_message once with operationKey "smoke-email", subject "Stageflow channels test"
25
+ and text "Hello! This email was sent by a Stageflow test pipeline."
26
+ The recipient is fixed by configuration; never try to choose or change it.
27
+ If the call is repeated, use the same operationKey and the same content.
28
+ Never resend an uncertain submission (code CHANNEL_SEND_OUTCOME_UNKNOWN) with a different key.
29
+ Do not send messages through shell commands or any other tool.
30
+ Write a short receipt via write_stage_artifact. Do not include secrets.
31
+ When finished, call emit_stage_envelope exactly once with payload.email set to "sent" or "failed".
32
+ If the send failed, use status failure.
@@ -0,0 +1,31 @@
1
+ id: send-text
2
+ model: cursor/auto
3
+ # One channel per stage. The recipient is a phone number in E.164 form. On a Free or Pro Photon
4
+ # project they must be a project user who has texted their assigned line once.
5
+ channels:
6
+ - connection: imessage
7
+ to: "+10000000000"
8
+ operations: [send]
9
+ io:
10
+ input:
11
+ schema:
12
+ type: object
13
+ additionalProperties: true
14
+ output:
15
+ schema:
16
+ type: object
17
+ required: [text]
18
+ properties:
19
+ text: { type: string, enum: [sent, failed] }
20
+ additionalProperties: false
21
+ system_prompt: |
22
+ Send one test text message, then report the result.
23
+ Call send_message once with operationKey "smoke-text" and text
24
+ "Hello! This text was sent by a Stageflow test pipeline."
25
+ The recipient is fixed by configuration; never try to choose or change it.
26
+ If the call is repeated, use the same operationKey and the same content.
27
+ Never resend an uncertain submission (code CHANNEL_SEND_OUTCOME_UNKNOWN) with a different key.
28
+ Do not send messages through shell commands or any other tool.
29
+ Write a short receipt via write_stage_artifact. Do not include secrets.
30
+ When finished, call emit_stage_envelope exactly once with payload.text set to "sent" or "failed".
31
+ If the send failed, use status failure.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stageflow",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Stageflow — CLI pipeline runtime for configurable stages on Pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -82,11 +82,11 @@
82
82
  "@modelcontextprotocol/node": "^2.0.0",
83
83
  "@modelcontextprotocol/server": "^2.0.0",
84
84
  "better-sqlite3": "^13.0.3",
85
+ "croner": "^10.0.1",
85
86
  "imapflow": "^2.2.5",
87
+ "jiti": "^2.7.0",
86
88
  "mailparser": "^3.9.36",
87
89
  "nodemailer": "^10.0.15",
88
- "croner": "^10.0.1",
89
- "jiti": "^2.7.0",
90
90
  "octokit": "^5.0.5",
91
91
  "pi-cursor-sdk": "^0.5.0",
92
92
  "pi-mcp-adapter": "^2.32.1",
@@ -98,5 +98,10 @@
98
98
  },
99
99
  "allowScripts": {
100
100
  "better-sqlite3@13.0.3": true
101
+ },
102
+ "optionalDependencies": {
103
+ "@spectrum-ts/core": "12.10.1",
104
+ "@spectrum-ts/imessage": "12.10.1",
105
+ "@spectrum-ts/whatsapp-business": "12.10.1"
101
106
  }
102
107
  }