stageflow 0.42.0 → 0.44.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.
- package/README.md +12 -3
- package/dist/agent/activity.d.ts +18 -0
- package/dist/agent/claudeAdapter.js +7 -0
- package/dist/agent/claudeTools.d.ts +27 -18
- package/dist/agent/claudeTools.js +54 -15
- package/dist/agent/compactionEvents.d.ts +34 -0
- package/dist/agent/compactionEvents.js +37 -0
- package/dist/agent/openRouterRouting.d.ts +7 -0
- package/dist/agent/openRouterRouting.js +23 -0
- package/dist/agent/piAdapter.d.ts +6 -0
- package/dist/agent/piAdapter.js +128 -27
- package/dist/agent/piSettings.d.ts +7 -0
- package/dist/agent/piSettings.js +9 -0
- package/dist/agent/sandboxPiTools.d.ts +3 -1
- package/dist/agent/sandboxPiTools.js +8 -2
- package/dist/agent/stageTurnDriver.d.ts +11 -2
- package/dist/agent/stageTurnDriver.js +45 -4
- package/dist/agent/toolOutputBudget.d.ts +15 -1
- package/dist/agent/toolOutputBudget.js +18 -0
- package/dist/agent/toolOutputBudgetExtension.d.ts +2 -0
- package/dist/agent/toolOutputBudgetExtension.js +40 -3
- package/dist/agents/authorChat.d.ts +1 -0
- package/dist/agents/authorChat.js +7 -0
- package/dist/agents/authorSessionStore.d.ts +3 -0
- package/dist/agents/authorSessionStore.js +17 -2
- package/dist/agents/hostContext.d.ts +1 -1
- package/dist/agents/runtime/piRuntime.d.ts +5 -1
- package/dist/agents/runtime/piRuntime.js +46 -12
- package/dist/agents/service.js +3 -2
- package/dist/agents/sessions.js +3 -1
- package/dist/compaction/directives.d.ts +18 -0
- package/dist/compaction/directives.js +119 -0
- package/dist/compaction/extension.d.ts +20 -0
- package/dist/compaction/extension.js +78 -0
- package/dist/compaction/mask.d.ts +18 -0
- package/dist/compaction/mask.js +155 -0
- package/dist/compaction/pin.d.ts +21 -0
- package/dist/compaction/pin.js +270 -0
- package/dist/compaction/scrub.d.ts +7 -0
- package/dist/compaction/scrub.js +26 -0
- package/dist/compaction/sessionWiring.d.ts +22 -0
- package/dist/compaction/sessionWiring.js +26 -0
- package/dist/compaction/summarize.d.ts +79 -0
- package/dist/compaction/summarize.js +171 -0
- package/dist/compaction/toolPolicy.d.ts +3 -0
- package/dist/compaction/toolPolicy.js +33 -0
- package/dist/compaction/types.d.ts +45 -0
- package/dist/compaction/types.js +7 -0
- package/dist/compaction/workingState.d.ts +56 -0
- package/dist/compaction/workingState.js +198 -0
- package/dist/config/createPipeline.js +2 -0
- package/dist/config/createTrigger.js +7 -1
- package/dist/config/ensureCatalogScanRoot.d.ts +2 -0
- package/dist/config/ensureCatalogScanRoot.js +6 -0
- package/dist/config/evalCatalog.js +30 -2
- package/dist/config/githubTriggerAction.d.ts +8 -0
- package/dist/config/githubTriggerAction.js +29 -0
- package/dist/config/hostConfig.js +2 -0
- package/dist/config/loadEval.js +21 -3
- package/dist/config/pipelineNeeds.d.ts +2 -0
- package/dist/config/pipelineNeeds.js +16 -3
- package/dist/config/pipelineRoute.js +5 -4
- package/dist/config/validateCatalog.d.ts +1 -1
- package/dist/config/validateCatalog.js +12 -0
- package/dist/config/validateEval.js +43 -2
- package/dist/config/writeEval.js +2 -2
- package/dist/envelope/assertEmittedArtifacts.d.ts +12 -0
- package/dist/envelope/assertEmittedArtifacts.js +43 -0
- package/dist/envelope/preEmitChecks.d.ts +3 -0
- package/dist/evals/constants.d.ts +3 -1
- package/dist/evals/constants.js +3 -1
- package/dist/evals/engine/FakeEngine.d.ts +1 -1
- package/dist/evals/engine/FakeEngine.js +2 -1
- package/dist/evals/engine/promptfoo/PromptfooEngine.d.ts +1 -1
- package/dist/evals/engine/promptfoo/PromptfooEngine.js +2 -1
- package/dist/evals/engine/promptfoo/generate.d.ts +1 -1
- package/dist/evals/engine/promptfoo/generate.js +11 -8
- package/dist/evals/engine/promptfoo/rubricPrompt.d.ts +1 -1
- package/dist/evals/engine/promptfoo/rubricPrompt.js +5 -3
- package/dist/evals/manager.d.ts +13 -0
- package/dist/evals/manager.js +10 -2
- package/dist/evals/plan.d.ts +8 -1
- package/dist/evals/plan.js +28 -9
- package/dist/evals/planInternalAgent.d.ts +19 -0
- package/dist/evals/planInternalAgent.js +205 -0
- package/dist/evals/read/api.d.ts +12 -0
- package/dist/evals/read/api.js +5 -0
- package/dist/evals/read/list.js +10 -1
- package/dist/evals/read/runs.d.ts +5 -0
- package/dist/evals/read/runs.js +7 -1
- package/dist/evals/runner/caseRunner.d.ts +2 -1
- package/dist/evals/runner/caseRunner.js +16 -5
- package/dist/evals/runner/internalAgentCaseRunner.d.ts +6 -0
- package/dist/evals/runner/internalAgentCaseRunner.js +250 -0
- package/dist/evals/snapshot.d.ts +10 -2
- package/dist/evals/snapshot.js +8 -3
- package/dist/evals/types.d.ts +12 -2
- package/dist/evals/types.js +4 -1
- package/dist/guide/cardContract.d.ts +133 -0
- package/dist/guide/cardContract.js +156 -0
- package/dist/guide/chat.d.ts +45 -0
- package/dist/guide/chat.js +378 -0
- package/dist/guide/knowledge/index.d.ts +14 -0
- package/dist/guide/knowledge/index.js +109 -0
- package/dist/guide/knowledge/topics/agents.d.ts +2 -0
- package/dist/guide/knowledge/topics/agents.js +58 -0
- package/dist/guide/knowledge/topics/bestPractices.d.ts +2 -0
- package/dist/guide/knowledge/topics/bestPractices.js +67 -0
- package/dist/guide/knowledge/topics/connections.d.ts +2 -0
- package/dist/guide/knowledge/topics/connections.js +66 -0
- package/dist/guide/knowledge/topics/consoleMap.d.ts +2 -0
- package/dist/guide/knowledge/topics/consoleMap.js +55 -0
- package/dist/guide/knowledge/topics/evals.d.ts +2 -0
- package/dist/guide/knowledge/topics/evals.js +72 -0
- package/dist/guide/knowledge/topics/limitations.d.ts +2 -0
- package/dist/guide/knowledge/topics/limitations.js +84 -0
- package/dist/guide/knowledge/topics/mcpSkillsBrowser.d.ts +2 -0
- package/dist/guide/knowledge/topics/mcpSkillsBrowser.js +57 -0
- package/dist/guide/knowledge/topics/memories.d.ts +2 -0
- package/dist/guide/knowledge/topics/memories.js +63 -0
- package/dist/guide/knowledge/topics/modelsAndProviders.d.ts +2 -0
- package/dist/guide/knowledge/topics/modelsAndProviders.js +56 -0
- package/dist/guide/knowledge/topics/overview.d.ts +2 -0
- package/dist/guide/knowledge/topics/overview.js +56 -0
- package/dist/guide/knowledge/topics/pipelines.d.ts +2 -0
- package/dist/guide/knowledge/topics/pipelines.js +93 -0
- package/dist/guide/knowledge/topics/stages.d.ts +2 -0
- package/dist/guide/knowledge/topics/stages.js +54 -0
- package/dist/guide/knowledge/topics/tasks.d.ts +2 -0
- package/dist/guide/knowledge/topics/tasks.js +52 -0
- package/dist/guide/knowledge/topics/triggers.d.ts +2 -0
- package/dist/guide/knowledge/topics/triggers.js +68 -0
- package/dist/guide/knowledge/topics/troubleshooting.d.ts +2 -0
- package/dist/guide/knowledge/topics/troubleshooting.js +85 -0
- package/dist/guide/knowledgeTools.d.ts +2 -0
- package/dist/guide/knowledgeTools.js +56 -0
- package/dist/guide/showUi.d.ts +6 -0
- package/dist/guide/showUi.js +546 -0
- package/dist/guide/threadStore.d.ts +48 -0
- package/dist/guide/threadStore.js +189 -0
- package/dist/guide/writeRoot.d.ts +11 -0
- package/dist/guide/writeRoot.js +70 -0
- package/dist/hosted/translate.js +2 -0
- package/dist/mcp/agentTools.js +12 -0
- package/dist/mcp/catalogTools.js +18 -20
- package/dist/mcp/catalogWriteTools.d.ts +8 -0
- package/dist/mcp/catalogWriteTools.js +225 -0
- package/dist/mcp/connectionTools.d.ts +3 -0
- package/dist/mcp/connectionTools.js +85 -0
- package/dist/mcp/controlTools.js +34 -1
- package/dist/mcp/deps.d.ts +9 -0
- package/dist/mcp/evalTools.js +684 -21
- package/dist/mcp/memoryHostTools.d.ts +3 -0
- package/dist/mcp/memoryHostTools.js +72 -0
- package/dist/mcp/pipelineAuthorTools.js +14 -1
- package/dist/mcp/server.js +5 -0
- package/dist/mcp/tools.js +6 -0
- package/dist/mcp/triggerTools.js +77 -31
- package/dist/operatorAgent/evalGate.d.ts +22 -0
- package/dist/operatorAgent/evalGate.js +77 -0
- package/dist/operatorAgent/fakeHost.js +10 -2
- package/dist/operatorAgent/host.js +18 -2
- package/dist/operatorAgent/index.d.ts +1 -0
- package/dist/operatorAgent/index.js +1 -0
- package/dist/operatorAgent/internalAgents.d.ts +11 -0
- package/dist/operatorAgent/internalAgents.js +13 -0
- package/dist/operatorAgent/piModel.d.ts +5 -1
- package/dist/operatorAgent/piModel.js +15 -10
- package/dist/operatorAgent/profiles/agentAuthor.js +66 -22
- package/dist/operatorAgent/profiles/agentAuthorPlaybook.d.ts +1 -1
- package/dist/operatorAgent/profiles/agentAuthorPlaybook.js +1 -1
- package/dist/operatorAgent/profiles/guideConfirm.d.ts +21 -0
- package/dist/operatorAgent/profiles/guideConfirm.js +100 -0
- package/dist/operatorAgent/profiles/guideTools.d.ts +7 -0
- package/dist/operatorAgent/profiles/guideTools.js +123 -0
- package/dist/operatorAgent/profiles/stageflowGuide.d.ts +7 -0
- package/dist/operatorAgent/profiles/stageflowGuide.js +132 -0
- package/dist/operatorAgent/profiles/workshopAuthor.js +23 -0
- package/dist/operatorAgent/profiles/workshopAuthorPlaybook.d.ts +1 -1
- package/dist/operatorAgent/profiles/workshopAuthorPlaybook.js +9 -1
- package/dist/operatorAgent/profiles/workshopAuthorTools.d.ts +2 -0
- package/dist/operatorAgent/profiles/workshopAuthorTools.js +197 -9
- package/dist/operatorAgent/types.d.ts +23 -0
- package/dist/package-meta.d.ts +1 -1
- package/dist/package-meta.js +1 -1
- package/dist/runstore/retention.d.ts +2 -1
- package/dist/runstore/retention.js +3 -7
- package/dist/runstore/runStatusClock.d.ts +17 -0
- package/dist/runstore/runStatusClock.js +19 -0
- package/dist/runstore/sqlite/SqliteRunStore.d.ts +1 -0
- package/dist/runstore/sqlite/SqliteRunStore.js +45 -45
- package/dist/runstore/workspaceLayout.js +6 -1
- package/dist/runtime/artifactDiskInspect.d.ts +14 -0
- package/dist/runtime/artifactDiskInspect.js +52 -0
- package/dist/runtime/artifactPath.d.ts +24 -0
- package/dist/runtime/artifactPath.js +84 -0
- package/dist/runtime/completionCheckRunner.js +15 -43
- package/dist/runtime/githubPollSource.d.ts +22 -4
- package/dist/runtime/githubPollSource.js +93 -8
- package/dist/runtime/priorArtifactGrants.d.ts +8 -0
- package/dist/runtime/priorArtifactGrants.js +105 -0
- package/dist/runtime/runActionEligibility.d.ts +46 -0
- package/dist/runtime/runActionEligibility.js +123 -0
- package/dist/runtime/runManager.d.ts +4 -1
- package/dist/runtime/runManager.js +52 -10
- package/dist/runtime/runRetryCoordinator.d.ts +2 -14
- package/dist/runtime/runRetryCoordinator.js +3 -67
- package/dist/runtime/sandboxContainer.d.ts +7 -0
- package/dist/runtime/sandboxContainer.js +48 -6
- package/dist/runtime/sandboxDesk.d.ts +2 -1
- package/dist/runtime/sandboxDesk.js +11 -12
- package/dist/runtime/stageEnvironment.js +1 -0
- package/dist/runtime/stageRoots.d.ts +12 -0
- package/dist/runtime/stageSandbox.d.ts +2 -1
- package/dist/runtime/stageSandbox.js +18 -2
- package/dist/runtime/stageWorker.js +20 -0
- package/dist/server/agentAuthorRoutes.js +12 -3
- package/dist/server/bootstrap.d.ts +5 -0
- package/dist/server/bootstrap.js +14 -1
- package/dist/server/evalRoutes.js +38 -9
- package/dist/server/guideRoutes.d.ts +5 -0
- package/dist/server/guideRoutes.js +166 -0
- package/dist/server/http.d.ts +10 -0
- package/dist/server/http.js +35 -1
- package/dist/server/internalAgentRoutes.d.ts +6 -0
- package/dist/server/internalAgentRoutes.js +12 -0
- package/dist/server/mcpHost.js +2 -0
- package/dist/toolkit/meta.d.ts +1 -1
- package/dist/toolkit/meta.js +39 -1
- package/dist/toolkit/profiles.d.ts +5 -0
- package/dist/toolkit/profiles.js +12 -0
- package/dist/tools/askOperator.js +2 -1
- package/dist/tools/emitStageEnvelope.d.ts +17 -16
- package/dist/tools/emitStageEnvelope.js +46 -32
- package/dist/tools/stageToolNames.d.ts +4 -0
- package/dist/tools/stageToolNames.js +4 -0
- package/dist/tools/workingState.d.ts +40 -0
- package/dist/tools/workingState.js +108 -0
- package/dist/tools/writeStageArtifact.d.ts +0 -9
- package/dist/tools/writeStageArtifact.js +2 -1
- package/dist/ui/assets/{MarkdownText-BTrOqu5J.js → MarkdownText-S5C_vemc.js} +2 -2
- package/dist/ui/assets/adapters-C0l4ruiR.js +17 -0
- package/dist/ui/assets/chat-CjnsmvqR.js +2 -0
- package/dist/ui/assets/chat-DFDd4UjS.css +2 -0
- package/dist/ui/assets/{main-CHlmTNJe.css → main-Del1GeLf.css} +1 -1
- package/dist/ui/assets/main-_yXVqcW9.js +277 -0
- package/dist/ui/chat.html +3 -4
- package/dist/ui/index.html +3 -4
- package/dist/workshop/chatTurn.js +1 -1
- package/dist/workshop/workshopPin.d.ts +3 -3
- package/dist/workshop/workshopPin.js +16 -15
- package/examples/compaction-stress/README.md +30 -0
- package/examples/compaction-stress/check-run.mjs +53 -0
- package/examples/compaction-stress/collect-evidence.yaml +60 -0
- package/examples/compaction-stress/compaction-stress.pipeline.yaml +141 -0
- package/examples/compaction-stress/compaction-stress.task.yaml +15 -0
- package/examples/compaction-stress/generate-evidence.mjs +110 -0
- package/examples/compaction-stress/root-cause.yaml +26 -0
- package/examples/compaction-stress/stageflow.yaml +9 -0
- package/examples/compaction-stress/write-postmortem.yaml +40 -0
- package/examples/evals/README.md +18 -0
- package/examples/evals/guide-behavior.dataset.jsonl +15 -0
- package/examples/evals/guide-behavior.eval.yaml +35 -0
- package/examples/evals/guide-depth.dataset.jsonl +35 -0
- package/examples/evals/guide-depth.eval.yaml +169 -0
- package/examples/memory/evals/guide-behavior.dataset.jsonl +15 -0
- package/examples/memory/evals/guide-behavior.eval.yaml +35 -0
- package/examples/memory/evals/guide-depth.dataset.jsonl +35 -0
- package/examples/memory/evals/guide-depth.eval.yaml +169 -0
- package/package.json +1 -1
- package/dist/ui/assets/AssistantRuntimeProvider-qIX1xNoH.js +0 -9
- package/dist/ui/assets/ReadonlyStore-BfXqHykm.js +0 -6
- package/dist/ui/assets/chat-Df_wCpak.js +0 -5
- package/dist/ui/assets/chat-P7KQznHm.css +0 -2
- package/dist/ui/assets/main-CvVfxmMd.js +0 -271
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const connectionsTopic = {
|
|
2
|
+
id: "connections",
|
|
3
|
+
title: "Connections and stage channels",
|
|
4
|
+
summary: "Host-level messaging connections (AgentMail, Slack, Telegram, iMessage, WhatsApp), how a stage sends with a pinned recipient, the one-channel-per-stage limit, secrets, live checks, and why an unknown send is never resent.",
|
|
5
|
+
body: `# Connections and stage channels
|
|
6
|
+
|
|
7
|
+
A **connection** is a host-level link to a messaging provider. A stage lists it under \`channels:\` with the recipient fixed, and gets one tool, \`send_message\`. An agent can also answer people on one connection (see the agents topic).
|
|
8
|
+
|
|
9
|
+
## Providers
|
|
10
|
+
|
|
11
|
+
| Provider | What \`to\` is | Notes |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| AgentMail | One email or a list of up to 20, optional \`cc\` (up to 20). No \`bcc\`. | Uses one existing inbox (\`config.inbox\`). Plain text only, up to 64 KiB, optional subject. Key needs inbox read and send. |
|
|
14
|
+
| Slack | One id: channel \`C…\`, private \`G…\`, DM \`D…\` or user \`U…\`. Names like \`#general\` are refused. | Bot token (\`chat:write\`). A private channel needs the bot invited. |
|
|
15
|
+
| Telegram | Numeric chat id or a public channel \`@username\`. | The person must start the bot first. Text up to 4096 characters. |
|
|
16
|
+
| iMessage (Photon) | E.164 phone or Apple ID email, one recipient. | Free/Pro Photon projects: the person must be a registered project user and must text their assigned line once first. |
|
|
17
|
+
| WhatsApp (Photon) | E.164 phone, one recipient. | Free text only within 24 hours of the person's last message; otherwise pin an approved \`template\`. Send-only for everyone. |
|
|
18
|
+
|
|
19
|
+
iMessage and WhatsApp need the optional \`@spectrum-ts/*\` packages; without them sends fail with \`CHANNEL_PROVIDER_UNSUPPORTED\`.
|
|
20
|
+
|
|
21
|
+
## Stage YAML
|
|
22
|
+
|
|
23
|
+
\`\`\`yaml
|
|
24
|
+
channels:
|
|
25
|
+
- connection: ops-slack
|
|
26
|
+
to: C0123ABCD
|
|
27
|
+
operations: [send]
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
- \`connection\` (id), \`to\` (pinned recipient), \`operations\` (\`[send]\` is the only value today) are required. Optional: \`alias\`, \`cc\` (providers that support it), \`template\` (WhatsApp only).
|
|
31
|
+
- **One channel per stage** (\`MAX_CHANNELS_PER_STAGE\` is 1). A second entry is rejected at validate, in the console, at \`start_run\`, at run start and at send, including one inherited from a pipeline-level default. To notify on two providers, use two stages. One AgentMail connection can still reach several people through its \`to\` and \`cc\` lists.
|
|
32
|
+
- \`channels\` is a body key: put it in the stage file or inline entry, not on a \`uses:\` wrapper.
|
|
33
|
+
- A pipeline-level \`channels:\` is inherited by every stage; \`channels: []\` on a stage drops it.
|
|
34
|
+
- The recipient is chosen by the author. The agent can never pick a different one.
|
|
35
|
+
- Pi backend only. On the Claude backend a stage with \`channels:\` fails at start.
|
|
36
|
+
- Tell the agent in \`system_prompt\` what to send. It calls \`send_message\` with an \`operationKey\`.
|
|
37
|
+
|
|
38
|
+
## Secrets
|
|
39
|
+
|
|
40
|
+
- A secret is never a value in YAML. In \`connections.yaml\` it is \`env:NAME\` (read from the Host environment or \`NAME_FILE\`) or \`store:...\` (written by the console or tools into \`channel-secrets.json\`, mode 0600).
|
|
41
|
+
- \`create_connection\` and \`update_connection\` store secret values; no tool, API or screen ever returns them. Secrets never reach run state, logs, envelopes, artifacts or the stage worker.
|
|
42
|
+
- Do not repeat a secret back to the user.
|
|
43
|
+
|
|
44
|
+
## Where connections live
|
|
45
|
+
|
|
46
|
+
Host-level: \`$STAGEFLOW_HOME/connections.yaml\` (default \`~/.stageflow/connections.yaml\`), shared by every project on the Host. A \`connections.yaml\` next to a project's \`stageflow.yaml\` wins for that project. \`STAGEFLOW_CONNECTIONS_FILE\` overrides both. Console and tool edits apply without a restart; a hand edit needs a Host restart. Limits: 256 KiB, 100 connections, 20 shared credentials.
|
|
47
|
+
|
|
48
|
+
## Checks
|
|
49
|
+
|
|
50
|
+
1. \`validate\`: the connection exists and is enabled, the provider supports the operation, the target is valid. No network, no secret read.
|
|
51
|
+
2. Run start (also \`preflight\` and \`sf doctor\`): a live check of each connection. Failure blocks the run with \`channel_check_failed\`. It never sends a message.
|
|
52
|
+
3. The Host re-checks enabled connections every 5 minutes; \`test_connection\` checks values without saving.
|
|
53
|
+
|
|
54
|
+
## Sending and retries
|
|
55
|
+
|
|
56
|
+
- The Host sends with the pinned target. A repeated \`operationKey\` with the same content returns the first result without sending again; the same key with different content is \`CHANNEL_OPERATION_CONFLICT\`.
|
|
57
|
+
- A send that may have reached the provider is \`CHANNEL_SEND_OUTCOME_UNKNOWN\` and is **never resent**, even after a restart. Only definite failures (refused connection, DNS/TLS error, 4xx) may be retried, under a new key.
|
|
58
|
+
- Accepted means the provider took the message, not that anyone read it.
|
|
59
|
+
|
|
60
|
+
## Tools
|
|
61
|
+
|
|
62
|
+
\`list_connections\` (secret fields show only \`env\` or \`store\`), \`create_connection\`, \`update_connection\` (enable, rename, config, replace secrets), \`test_connection\`, \`validate_connection_target\` (checks a recipient against provider rules, no network), \`remove_connection\` (removes the entry and its stored secrets; destructive).
|
|
63
|
+
|
|
64
|
+
Email accounts (\`email.yaml\`, IMAP/SMTP, used by email triggers and the stage \`email\` permissions) are separate from connections. An IMAP account cannot be an agent channel; AgentMail can.
|
|
65
|
+
`,
|
|
66
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const consoleMapTopic = {
|
|
2
|
+
id: "console_map",
|
|
3
|
+
title: "Console map: where things live",
|
|
4
|
+
summary: "The operator console's sidebar sections and hash routes (#/inbox, #/pipelines, #/agents, #/triggers, #/connections, #/memories, #/evals, #/settings, …) and what to do on each page.",
|
|
5
|
+
body: `# Console map
|
|
6
|
+
|
|
7
|
+
The console runs at the Host's address (\`sf ui\`, default \`http://127.0.0.1:3847\`). Pages are hash routes, so a link looks like \`#/pipelines\`. When you tell a user where to look, give the sidebar label and the route.
|
|
8
|
+
|
|
9
|
+
## Sidebar
|
|
10
|
+
|
|
11
|
+
**Top**
|
|
12
|
+
- **Guide** — \`#/guide\`. This chat.
|
|
13
|
+
- **Overview** — \`#/overview\`. What needs you, runs in flight, system health (agent slots, providers, connections needing attention, triggers armed, disk), KPIs and spend for 24h / 7d / 30d.
|
|
14
|
+
- **Inbox** — \`#/inbox\` (home page). Tabs: **Needs you** (pipeline gates and agent approvals; answer here), **Failed** (\`#/inbox?tab=failed\`, retry a stage), **Done today** (\`#/inbox?tab=done_today\`).
|
|
15
|
+
|
|
16
|
+
**Activity**
|
|
17
|
+
- **Pipeline runs** — \`#/runs\`. Run list with filters. A run: \`#/runs/<runId>\`; a stage: \`#/runs/<runId>/stages/<stageId>\` (Transcript, Events, Envelope, Artifacts, and Retry / Resume / Abandon / answer panel); the envelope: \`#/runs/<runId>/stages/<stageId>/envelope\`; an artifact: \`#/runs/<runId>/artifacts?path=…\`.
|
|
18
|
+
- **Agent sessions** — \`#/agent-sessions\`. Sessions across all agents.
|
|
19
|
+
|
|
20
|
+
**Build**
|
|
21
|
+
- **Pipelines** — \`#/pipelines\`. List; **New pipeline** opens the Workshop. One pipeline: \`#/pipelines/<id>\` opens the pipeline editor (stage graph, inspector with the stage **Channels** section, YAML panel, Problems panel with quick fixes; tabs Editor, Runs, History).
|
|
22
|
+
- **Agents** — \`#/agents\`. Directory with status (Enabled, Disabled, Needs setup) and reach. New: \`#/agents/new\` (form plus author chat; always created disabled). One agent: \`#/agents/<id>\` (Enable/Disable, web chat card, Sessions, Configuration); edit: \`#/agents/<id>/edit\` (tools, approvals, limits, channel, schedule, web chat, version history, Remove = archive). A session: \`#/agents/<id>/sessions/<sessionId>\`; one turn: \`…/runs/<runId>\` (Steps, Waterfall, Messages, Logs, Configuration).
|
|
23
|
+
- **Tasks** — \`#/tasks\`. Task files with their last run; one task: \`#/tasks/<id>\`.
|
|
24
|
+
- **Catalog** — \`#/catalog?tab=stages\`. Stage files (\`#/stages/<path>\` opens one) and **Skills** (\`#/catalog?tab=skills\` or \`#/skills\`; install a skill here).
|
|
25
|
+
- **Evals** — \`#/evals\`. List with status (never run, running, passing, failing, regressed, saturated) and **Try the sample eval**. New: \`#/evals/new\`. One eval: \`#/evals/<id>\`, edit \`#/evals/<id>/edit\`, a run \`#/evals/<id>/runs/<n>\` (tabs Overview, Cases, Graders, Config), a case \`…/case/<caseId>\`, compare \`#/evals/<id>/compare\`. Datasets: \`#/datasets\`, \`#/datasets/<id>\`.
|
|
26
|
+
|
|
27
|
+
**Connect**
|
|
28
|
+
- **Triggers** — \`#/triggers\`. Create (N), Fire (F, only enabled triggers with a catalog task), enable/disable (E). One trigger: \`#/triggers/<id>\`. The form edits \`event.source\` but not \`event.config\`.
|
|
29
|
+
- **Connections** — \`#/connections\`. Communication channels, email accounts and MCP tool servers. **Add connection**, Test connection. One connection: \`#/connections/<id>\` (status, "Use in a stage" snippet, Enable/Disable, replace key, Disconnect).
|
|
30
|
+
- **Memories** — \`#/memories\`. Create a memory, edit its cover, open, correct or delete cards. One memory: \`#/memories/<id>\`.
|
|
31
|
+
|
|
32
|
+
## Not in the sidebar
|
|
33
|
+
|
|
34
|
+
- **Start a run** — \`#/new\` (also the rail button). Pick a task and a pipeline; shows provider and validity before starting. \`?pipeline=\` and \`?task=\` preselect.
|
|
35
|
+
- **Workshop** — \`#/workshop\`. Design a pipeline by chat; opened from Pipelines (New pipeline, or Open in Workshop). Saves to \`workshop/<pipeline-id>/\` unless told otherwise.
|
|
36
|
+
- **Settings** — \`#/settings\` (rail footer). Sections: General (Workshop model, disk), Providers (connect, replace key, sign in again, disconnect), Concurrency (agent slots), MCP server (this console's own MCP address), Project MCP (add servers, Check, Sign in, MCP secrets), Notifications (desktop notification when a gate or approval opens).
|
|
37
|
+
- **Connect** — \`#/connect\`. Guided provider setup.
|
|
38
|
+
- **Public web chat** — \`/chat/<slug>\` on the Host (not a console page). Live only while the agent and its web chat are enabled.
|
|
39
|
+
|
|
40
|
+
## Where to send the user for common jobs
|
|
41
|
+
|
|
42
|
+
| Job | Page |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Answer a question a stage asked, approve an agent action | Inbox \`#/inbox\` |
|
|
45
|
+
| See why a run failed | \`#/runs/<runId>\`, open the stage, Transcript and Envelope |
|
|
46
|
+
| Connect a model provider | Settings → Providers, or \`#/connect\` |
|
|
47
|
+
| Add an MCP server or MCP secret | Settings → Project MCP |
|
|
48
|
+
| Add Slack / email / Telegram / iMessage / WhatsApp | Connections → Add connection |
|
|
49
|
+
| Install a skill | Catalog → Skills |
|
|
50
|
+
| Change a stage's channel recipient | Pipeline editor → select stage → Channels |
|
|
51
|
+
| Enable an agent, share its web chat link | \`#/agents/<id>\` |
|
|
52
|
+
| Delete a memory card | \`#/memories/<id>\` |
|
|
53
|
+
| Run or compare an eval | \`#/evals/<id>\` |
|
|
54
|
+
`,
|
|
55
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const evalsTopic = {
|
|
2
|
+
id: "evals",
|
|
3
|
+
title: "Evals: checking a stage or an agent",
|
|
4
|
+
summary: "Stage vs agent evals, datasets and scenarios, graders and which target kind each applies to, repeats and statistics, cost cap, judge providers, the engine install, read_only tool policy, the two consents for real tools, and sorting failures.",
|
|
5
|
+
body: `# Evals
|
|
6
|
+
|
|
7
|
+
An eval (\`evals/<id>.eval.yaml\`) runs one **target** over a **dataset** of cases, grades every result with **graders**, repeats each case, and lets you compare runs. Results are stored and survive restarts. Saving an eval never changes past runs.
|
|
8
|
+
|
|
9
|
+
## Target
|
|
10
|
+
|
|
11
|
+
- Stage: \`target: { kind: stage, pipeline: <path>, stage: <id> }\` or \`{ kind: stage, file: <stage file> }\`. Paths are relative to the eval file. Each case becomes a normal stage run (hidden from the Runs list), with \`input\` from the case and \`goal\` from the case, the eval's \`task.goal\`, or "Evaluate case <id>".
|
|
12
|
+
- Agent: \`target: { kind: agent, agent: <id> }\`. Each case is a conversation in a hidden eval session on the agent's current revision. No \`task\` block on agent targets.
|
|
13
|
+
|
|
14
|
+
## Dataset
|
|
15
|
+
|
|
16
|
+
A file in \`datasets/\`: \`.dataset.jsonl\` (editable in the console), \`.dataset.json\` or \`.dataset.csv\` (read-only in the console; convert to JSONL). Each case: \`id\` (required, stable), \`input\` (required object), optional \`title\`, \`expected\`, \`tags\`, \`goal\`, \`metadata\`. For a stage, \`input\` must match the stage's \`io.input.schema\`; cases that do not are skipped (\`dataset.input_mismatch\`, \`eval.cases_skipped\`). Fewer than 5 cases warns. Limits: 5,000 cases.
|
|
17
|
+
|
|
18
|
+
For an agent, \`input\` is a **scenario**: \`mode: script\` with \`script\` (1–40 user messages), or \`mode: simulated\` with \`opening\`, \`persona\`, \`goal\` and optional \`facts\`. Optional \`tool_mocks\`. \`expected\` may hold \`outcome\`, \`tools\`, \`forbidden_tools\`.
|
|
19
|
+
|
|
20
|
+
## Graders
|
|
21
|
+
|
|
22
|
+
Common keys: \`id\`, \`type\`, \`weight\` (default 1), \`must_pass\` (a failure fails the result). 1 to 20 graders.
|
|
23
|
+
|
|
24
|
+
| Type | Stage | Agent | What it checks |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| \`schema\` | yes | no | Success envelope whose payload matches \`io.output.schema\`. |
|
|
27
|
+
| \`field\` | yes | yes | Values at paths (\`exists\`, \`equals\`, \`contains\`, \`matches\`, \`in\`, \`length_gte\`, …). |
|
|
28
|
+
| \`reference\` | yes | yes | Compares with the case's \`expected\` (\`each_mentioned\` or \`equals\`). |
|
|
29
|
+
| \`rubric\` | yes | yes | A judge model grades against your words (\`pass_fail\` or \`1_to_5\`). Needs a judge. |
|
|
30
|
+
| \`code\` | yes | yes | A JavaScript function body; runs on the Host with your permissions, 5 s limit. |
|
|
31
|
+
| \`tool_calls\` | no | yes | \`must_call\`, \`must_not_call\`, \`must_ask_first\`, \`max_calls\`, \`args\`. |
|
|
32
|
+
| \`conversation_check\` | no | yes | \`max_turns\`, \`max_agent_questions_per_turn\`, \`final_reply\` checks. |
|
|
33
|
+
| \`goal_reached\` | no | yes | A judge decides whether the scenario goal was met. Needs a judge. |
|
|
34
|
+
|
|
35
|
+
A grader on the wrong kind is \`eval.grader_not_applicable\`. There is no \`command\` or \`groundedness\` grader.
|
|
36
|
+
|
|
37
|
+
## Defaults and statistics
|
|
38
|
+
|
|
39
|
+
\`repeats\` 1–10 (default 3), \`pass_threshold\` (default 0.8), \`max_cost_usd\` (default 2; agents 1), \`concurrency\` 1–8 (default 4; agents 2), \`judge\`, \`model\` (override the target's model), \`user_model\` (agent simulator, defaults to the judge). A result passes when no \`must_pass\` grader failed and its weighted score reaches \`pass_threshold\`. The run passes when its pass rate reaches \`pass_threshold\`. Reported: pass rate, a 95% interval by case, reliability (pass on every repeat), pass@k, flaky cases, latency and cost. Compare pairs two runs of the same eval by case: improved, regressed, inconclusive, or not enough data (fewer than 5 common cases).
|
|
40
|
+
|
|
41
|
+
## Cost
|
|
42
|
+
|
|
43
|
+
Every run has a cost cap (\`max_cost_usd\`) covering model calls and judge calls. When reached, the run stops as \`budget_stopped\`, remaining results are skipped, and it does not pass. For agent evals the cap is checked before each conversation starts, so a run can exceed it by up to \`concurrency\` conversations. A conversation can cost 4 to 10 times a stage case.
|
|
44
|
+
|
|
45
|
+
## Judges and the engine
|
|
46
|
+
|
|
47
|
+
- Judge and simulator models must be \`anthropic/…\`, \`openai/…\` or \`openrouter/…\`, with an API key (Pi credential of type \`api_key\` or \`ANTHROPIC_API_KEY\` / \`OPENAI_API_KEY\` / \`OPENROUTER_API_KEY\`). OAuth logins cannot judge. The stage itself can use any provider.
|
|
48
|
+
- Pick a judge different from the target's model (\`eval.judge_same_as_stage\` warns).
|
|
49
|
+
- The engine (promptfoo 0.124.0) is installed on demand: \`sf eval engine install\` (about 1.2 GB, needs Node 22.22+ and network once). Without it a run fails with \`EVAL_ENGINE_UNAVAILABLE\`.
|
|
50
|
+
- Only **one eval run is active per Host**. A second start fails with \`EVAL_RUN_ACTIVE\`.
|
|
51
|
+
|
|
52
|
+
## Agent eval safety
|
|
53
|
+
|
|
54
|
+
- \`conversation.tools\` defaults to \`read_only\`: read tools run; write, edit, bash, destructive or external Stageflow tools, unlisted MCP tools and browser tools are **stubbed** and recorded, not executed. List safe MCP tools in \`conversation.read_only_tools\` (built-in and Stageflow tools cannot be listed). \`mocked\` returns canned results from \`tool_mocks\`.
|
|
55
|
+
- \`tools: real\` needs two consents: \`conversation.allow_real_tools: true\` in the file **and** a per-run consent (\`allow_real_tools\` on \`run_eval\`, a checkbox in the console, \`--allow-real-tools\` on the CLI). Without the run consent: \`EVAL_REAL_TOOLS_NOT_CONFIRMED\`. Real tools act on the project and services from this machine.
|
|
56
|
+
- Approvals in evals never ask a person: \`record_only\` (default) records \`would_ask_first\`; \`deny\`; \`auto_approve_read\`.
|
|
57
|
+
- Always blocked in eval sessions: \`run_eval\`, \`sort_eval_failures\`, \`cancel_eval_run\`, \`agent_chat\`, \`fire_trigger\`; under \`read_only\`/\`mocked\` also \`probe_project_mcp\` and sub-agent calls.
|
|
58
|
+
- Eval sessions never send on channels, run schedules or use web chat, and are hidden from session lists, the Inbox and counts.
|
|
59
|
+
|
|
60
|
+
## What evals cannot do
|
|
61
|
+
|
|
62
|
+
No checkout or repository for cases. A stage that asks a person (HITL gate) records \`EVAL_STAGE_NEEDS_INPUT\`. Pipeline-entry overlays (entry-level \`mcp\`, \`secrets\`, \`requires\`, pipeline \`channels\`, \`schemas\`, \`include\`) are not applied when a pipeline stage is evaluated, so it can behave differently than inside its pipeline. No whole-pipeline evals, no scheduled evals, no judge calibration, no deleting an eval from the console.
|
|
63
|
+
|
|
64
|
+
## Sort failures
|
|
65
|
+
|
|
66
|
+
After a run, \`sort_eval_failures\` (manual only) suggests for each failed result a bucket (\`agent_wrong\`, \`grader_wrong\`, \`case_wrong\`, \`unclear\`) and a failure type. Classifier \`jev\` (TypeSafe; needs a TypeSafe key, about $0.04 per million input tokens, outside the cost cap) or \`judge\` (the run's judge model). Nothing is tagged until someone accepts (\`accept_eval_failure_suggestions\`).
|
|
67
|
+
|
|
68
|
+
## Tools
|
|
69
|
+
|
|
70
|
+
Read (free): \`list_evals\`, \`get_eval\`, \`validate_eval\`, \`list_eval_runs\`, \`get_eval_run\`, \`get_eval_results\`, \`get_eval_result\`, \`compare_eval_runs\`, \`get_eval_failure_suggestions\`, \`get_eval_failure_sort_status\`, \`get_eval_run_export\`. Write: \`create_eval\`, \`update_eval\`, \`create_dataset\`, \`update_dataset_cases\`, \`convert_dataset\`, \`install_eval_sample\`, \`put_eval_review\`, \`accept_eval_failure_suggestions\`, \`dismiss_eval_failure_suggestions\`. Costs money: \`run_eval\`, \`try_eval_case\`, \`sort_eval_failures\`. Also \`cancel_eval_run\`, \`delete_eval_run\` (destructive).
|
|
71
|
+
`,
|
|
72
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export const limitationsTopic = {
|
|
2
|
+
id: "limitations",
|
|
3
|
+
title: "Limitations: what Stageflow does not do",
|
|
4
|
+
summary: "Known gaps and sharp edges, each with what the user sees and the workaround: missing deletes, memory and channel limits, schedule triggers without a task, edit_pipeline keys, agent and eval restrictions, operator-only actions, backend gaps.",
|
|
5
|
+
body: `# Limitations
|
|
6
|
+
|
|
7
|
+
Each item: the limit, what the user sees, and the workaround.
|
|
8
|
+
|
|
9
|
+
## Deleting and renaming
|
|
10
|
+
|
|
11
|
+
- **No delete for catalog triggers.** There is no tool, API route or console delete. Workaround: \`set_trigger_enabled\` false; to remove it, delete the \`*.trigger.yaml\` file by hand.
|
|
12
|
+
- **No delete for pipelines, stage files, tasks, evals or datasets** through tools or the API. Workaround: delete the files by hand. What can be deleted: runs, eval runs, memory cards, connections, console MCP servers; agents are archived.
|
|
13
|
+
- **No delete for a whole memory, and its description cannot change after create.** No tool or route exists. Workaround: create a new memory with a new id, attach it instead, and stop using the old one.
|
|
14
|
+
- **Ids are fixed.** Agent ids cannot change (\`agent.id_immutable\`); \`update_trigger\` cannot change a trigger id; changing a connection id makes a new connection.
|
|
15
|
+
|
|
16
|
+
## Memories
|
|
17
|
+
|
|
18
|
+
- **Guide and operators cannot add a memory card.** \`write_memory_card\` only replaces an existing card (\`MEMORY_CARD_NOT_FOUND\` otherwise); the console cannot create cards either. Only stage and agent sessions add cards. Workaround: put seed facts on the cover page, or let the first run add cards.
|
|
19
|
+
- **Sessions cannot delete cards** or read previous copies. Only one previous copy is kept and there is no restore.
|
|
20
|
+
- **Caps:** 64,000 characters per cover or card, 200 cards (\`MEMORY_TOO_LARGE\`, \`MEMORY_TOO_MANY_CARDS\`).
|
|
21
|
+
- **No per-stage memories.** A pipeline's memories go to every stage.
|
|
22
|
+
|
|
23
|
+
## Channels and connections
|
|
24
|
+
|
|
25
|
+
- **One channel per stage.** A second entry, or one inherited from a pipeline default, fails with "a stage can use one channel for now". Workaround: two stages, or one AgentMail connection with several \`to\`/\`cc\` recipients.
|
|
26
|
+
- **Stage channels are send-only.** A stage never receives messages. WhatsApp is send-only for agents too. An IMAP email account cannot be an agent channel.
|
|
27
|
+
- **Connection secrets cannot be read back.** Tools and screens show only whether a secret comes from \`env\` or \`store\`. Workaround: replace it with \`update_connection\`.
|
|
28
|
+
- **An unknown send outcome is never resent** (\`CHANNEL_SEND_OUTCOME_UNKNOWN\`). Workaround: confirm with the recipient, then send deliberately with a new key.
|
|
29
|
+
- **Channels and memory tools are Pi-only.** On the Claude backend such stages fail at start.
|
|
30
|
+
|
|
31
|
+
## Triggers
|
|
32
|
+
|
|
33
|
+
- **A schedule trigger needs a catalog task.** \`create_trigger\` accepts a schedule without \`task\`, but every automatic fire fails with \`trigger.task_required\`. The console blocks it. Workaround: always set \`task\`.
|
|
34
|
+
- **Dynamic triggers cannot be fired from the console** (Fire is disabled). Workaround: \`fire_trigger\` with an inline \`task\`.
|
|
35
|
+
- **Only some event sources run.** GitHub (pull requests only, first poll fires nothing), signed webhook, IMAP email. Any other \`event.source\` is never watched. Email \`match\` is exact (no substring) and has no attachments; a new email trigger may need a Host restart. Webhooks need a reachable Host (loopback by default). The console cannot edit \`event.config\`; set it with \`create_trigger\`/\`update_trigger\` or YAML.
|
|
36
|
+
- **Automatic triggers need a running Host** (\`sf ui\`, \`sf mcp\` or Docker).
|
|
37
|
+
|
|
38
|
+
## Authoring tools
|
|
39
|
+
|
|
40
|
+
- **\`edit_pipeline\` only applies these patch keys:** \`id\`, \`model\`, \`agent\`, \`stages\`, \`schemas\`, \`requires\`, \`memories\`, \`channels\`. Others (\`browser\`, \`include\`) are silently ignored, and \`model\` cannot be cleared. \`stages\` replaces the whole list. Workaround: edit the YAML in the pipeline editor or by hand.
|
|
41
|
+
- **\`edit_stage\` merges fields and cannot remove one.** Workaround: \`write_catalog_file\` with the full stage YAML.
|
|
42
|
+
- **\`create_stage\` writes the Host default model** into the stage when none is passed, overriding the pipeline default.
|
|
43
|
+
- **Standalone task tools have no \`input\` argument** (\`create_task_file\`, \`update_task_file\`). Workaround: \`create_task\`/\`edit_task\` with \`input\` inside \`body\`, or edit the file.
|
|
44
|
+
- **No tool to log in to a model provider, add a project MCP server, set an MCP secret or install a skill.** These are done in Settings, the Catalog page or the CLI.
|
|
45
|
+
|
|
46
|
+
## Agents
|
|
47
|
+
|
|
48
|
+
- **A new agent always starts disabled.** Workaround: \`enable_agent\` after validating.
|
|
49
|
+
- **An agent cannot grant beyond what it holds, cannot weaken an ask-first it is bound by, and cannot edit, restore or archive itself.** The tool returns a refusal naming the extra grants.
|
|
50
|
+
- **Not functional yet:** \`model.backend: claude\` and \`execution: sandbox\` (sessions fail), \`tools.browser\` (stored, unused), \`approvals.approvers.channel_ids\` (ignored).
|
|
51
|
+
- **\`bash\` is not path-confined** and always asks first.
|
|
52
|
+
- **Restarts:** running or waiting turns fail with \`agent.host_restarted\`; pending approvals expire.
|
|
53
|
+
- **Cursor models** are refused for agents unless the Host opts in.
|
|
54
|
+
|
|
55
|
+
## Evals
|
|
56
|
+
|
|
57
|
+
- **The engine must be installed** (\`sf eval engine install\`, Node 22.22+, about 1.2 GB). Otherwise \`EVAL_ENGINE_UNAVAILABLE\`.
|
|
58
|
+
- **One eval run per Host.** A second start fails with \`EVAL_RUN_ACTIVE\`. Workaround: wait or \`cancel_eval_run\`.
|
|
59
|
+
- **Judges only from \`anthropic\`, \`openai\`, \`openrouter\`, with an API key** (not OAuth).
|
|
60
|
+
- **No checkout, no gates:** cases run without a repository; a stage that asks a person ends \`EVAL_STAGE_NEEDS_INPUT\`.
|
|
61
|
+
- **Pipeline overlays are not applied** to an evaluated pipeline stage (entry-level \`mcp\`, \`secrets\`, \`requires\`, pipeline \`channels\`, \`schemas\`, \`include\`).
|
|
62
|
+
- **Not built:** whole-pipeline evals, scheduled evals, judge calibration, \`command\` and \`groundedness\` graders, deleting an eval in the console.
|
|
63
|
+
- **Agent eval cost cap** is checked before each conversation, so it can be passed by up to \`concurrency\` conversations.
|
|
64
|
+
|
|
65
|
+
## Operator-only actions
|
|
66
|
+
|
|
67
|
+
- **Only a person can answer a pipeline gate (\`answer_gate\`), decide a feedback loop at its limit (\`decide_feedback_loop\`), or approve/deny an agent action.** Guide and other agents cannot. Workaround: point the user to the Inbox (\`#/inbox\`).
|
|
68
|
+
|
|
69
|
+
## Pipelines and runs
|
|
70
|
+
|
|
71
|
+
- **No run-level cost cap for pipelines.** Use cheaper models, \`timeout_ms\`, and small repair limits.
|
|
72
|
+
- **Route \`if\` is limited:** only required scalar fields, no \`exists\`, no else branch, no array indexes.
|
|
73
|
+
- **\`on: [failed]\` does not launch a stage after failure.**
|
|
74
|
+
- **A clone chain fails on an empty list or one longer than \`clone_cap\`.**
|
|
75
|
+
- **Validation does not check provider keys, env vars or live MCP connections.** Those fail at run start.
|
|
76
|
+
|
|
77
|
+
## MCP, skills, browser
|
|
78
|
+
|
|
79
|
+
- **OAuth-signed-in MCP servers do not work in pipeline stages.** Use a bearer-token secret.
|
|
80
|
+
- **MCP elicitation is not supported.**
|
|
81
|
+
- **Browser \`allow_domains\` is not enforced for profile stages**; passkeys and native prompts do not work; a login stage fails on a Host with no screen and no live view; another run waits for a leased profile with no time limit.
|
|
82
|
+
- **Hosted multi-user use is not built.** Browser profiles and connections use a single local owner.
|
|
83
|
+
`,
|
|
84
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const mcpSkillsBrowserTopic = {
|
|
2
|
+
id: "mcp_skills_browser",
|
|
3
|
+
title: "MCP servers, skills and browser sessions",
|
|
4
|
+
summary: "Giving stages and agents extra tools: project MCP servers (.mcp.json and console servers, secrets, OAuth), skills (binding and install), and browser sessions (profiles, login check, human login stage, limits).",
|
|
5
|
+
body: `# MCP servers, skills and browser sessions
|
|
6
|
+
|
|
7
|
+
## MCP servers
|
|
8
|
+
|
|
9
|
+
MCP servers give a stage or an agent tools in other systems (issue trackers, docs, web fetch, Playwright). Two sources, merged:
|
|
10
|
+
|
|
11
|
+
- the project \`.mcp.json\` next to \`stageflow.yaml\` (\`{ "mcpServers": { "name": { ... } } }\`);
|
|
12
|
+
- servers saved in the console (**Settings → Project MCP**, stored on the Host). A console server wins on a name clash. Project-file servers cannot be removed from the console.
|
|
13
|
+
|
|
14
|
+
A server is stdio (\`command\`, \`args\`, \`env\`, \`cwd\`) or http (\`url\`, \`headers\`, \`httpTransport\`). The name \`stageflow\` is reserved. Link-local and cloud-metadata URLs are refused.
|
|
15
|
+
|
|
16
|
+
**Secrets.** Tokens are moved out of the saved config into a secret store and replaced with \`\${NAME}\` placeholders. Values are write-only. Placeholders naming provider keys or Stageflow control tokens are refused unless allow-listed.
|
|
17
|
+
|
|
18
|
+
**Who fills \`\${NAME}\`:**
|
|
19
|
+
- Agents and the Check button: console secrets, plus Host variables named in \`STAGEFLOW_MCP_ENV_ALLOW\`.
|
|
20
|
+
- Pipeline stages: only console secrets the stage lists under \`secrets:\` (they fill MCP placeholders and are not put in the stage environment), plus the stage's curated environment.
|
|
21
|
+
- Repository-bound stages: never console servers or console secrets; they read the repository's own \`.mcp.json\`.
|
|
22
|
+
|
|
23
|
+
**OAuth.** Remote servers can be signed in from the console (copy the redirected address back into the dialog). Signed-in servers work for agents and Check only, **not for pipeline stages**; give a stage a bearer-token secret instead.
|
|
24
|
+
|
|
25
|
+
**Using it.**
|
|
26
|
+
- Stage: \`mcp: [linear]\` on the pipeline entry (or the stage file) plus \`secrets: [LINEAR_TOKEN]\` if needed. \`validate\` checks names and that stdio commands are on PATH; connect failures and unset variables fail at run time. Default connect timeout 30 s. Large tool results are written to an artifact file and the model sees a preview. MCP elicitation (a server asking the user a question) is not supported.
|
|
27
|
+
- Agent: \`tools.mcp: { linear: ["*"] }\` or a list of tool names. Grant id \`<server>.<tool>\`, usable in \`approvals.ask_first\`. Servers start lazily per session. An unknown server only warns (\`agent.mcp_server_unknown\`).
|
|
28
|
+
- Tools: \`list_project_mcp\` (read), \`probe_project_mcp\` (connects to the server). There is no tool to add or remove a project MCP server or set an MCP secret; that is done in Settings → Project MCP.
|
|
29
|
+
|
|
30
|
+
## Skills
|
|
31
|
+
|
|
32
|
+
A skill is an instruction bundle (\`SKILL.md\`) the agent loads.
|
|
33
|
+
|
|
34
|
+
- Stage: \`skill: <name>\` on the stage **body** (stage file or inline), not on a \`uses:\` wrapper. One skill per stage.
|
|
35
|
+
- Agent: \`tools.skills: [names]\`.
|
|
36
|
+
- Lookup order for a stage: skills shipped with the run (\`start_run.skills\`), then \`<checkout>/.pi/skills/<name>/\` (needs workspace trust for repository bindings), then the Host's Pi skills directory.
|
|
37
|
+
- A missing skill fails the stage before the agent starts, or fails the agent session.
|
|
38
|
+
- Install on the Host: console **Catalog → Skills** (Install), or \`sf skills install --from-zip <url> --skill-name <name>\`. \`list_skills\` shows name, description and origin. There is no tool to install a skill.
|
|
39
|
+
|
|
40
|
+
## Browser sessions
|
|
41
|
+
|
|
42
|
+
A stage with \`browser:\` drives a real Chrome through \`agent-browser\` (must be installed on the Host: \`npm i -g agent-browser && agent-browser install\`). The agent uses it through bash and the bundled \`browser\` skill.
|
|
43
|
+
|
|
44
|
+
- \`profile\`: a saved login on the Host. YAML names it, never a path. No profile means a throw-away browser.
|
|
45
|
+
- One shared browser per run and profile; each stage gets its own tab; tabs share cookies. A profile is leased to one run at a time: another run that needs it waits (no time limit) until the holder run ends.
|
|
46
|
+
- \`headed\` (default true) or \`false\`. Use one mode for all stages that share a profile.
|
|
47
|
+
- \`allow_domains\`: enforced only for stages without a profile. For profile stages it is only a prompt instruction plus an audit, not a security boundary.
|
|
48
|
+
- \`check\`: the Host opens \`check.url\` and decides logged in / out / unknown from \`logged_in_url\` and \`logged_out_url\` globs; the stage must emit \`{ logged_in, url }\`.
|
|
49
|
+
- Human login stage: \`verify: [{ type: browser_login }]\`, \`gate_kinds: [confirm]\`, \`browser.check\` set, \`headed\` not false, usually with \`on_verify_fail: { mode: repair, ... }\`. The operator logs in in a visible window or the console's live view, then confirms.
|
|
50
|
+
- Login pattern: check → login (only the check→login edge has \`if: logged_in eq false\`) → work, where work joins check and login with no \`if\` on its inbound edges. Putting an \`if\` on check→work silently skips work when the login stage runs.
|
|
51
|
+
- A Host with no screen and no live view (CLI-only run on a headless Linux) fails a login stage before the agent starts.
|
|
52
|
+
- Passkeys, hardware keys, camera, location and notification prompts do not work; permission prompts are denied.
|
|
53
|
+
- \`path\`, \`scope\`, \`secret\`, \`launch_args\`, \`executable_path\` are rejected in YAML; the Host decides those.
|
|
54
|
+
- Many sites forbid automation in their terms. Keep volume low and stay read-only where possible.
|
|
55
|
+
- Agents: \`tools.browser\` is stored but not wired to anything yet.
|
|
56
|
+
`,
|
|
57
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const memoriesTopic = {
|
|
2
|
+
id: "memories",
|
|
3
|
+
title: "Memories: durable notes for pipelines and agents",
|
|
4
|
+
summary: "Host memories with a cover page and keyed cards, attaching them to a pipeline or an agent, which memory tools a session gets, size caps, and what cannot be changed or deleted.",
|
|
5
|
+
body: `# Memories
|
|
6
|
+
|
|
7
|
+
A memory is a named store on the Host (\`$STAGEFLOW_HOME/memories/<id>/\`). It survives runs and conversations. It has:
|
|
8
|
+
|
|
9
|
+
- a **cover page** (\`body.md\`): one free-text page, replaced as a whole;
|
|
10
|
+
- **cards**: keyed notes, one per subject (a person, a ticket, a release, a path). The key is the subject's own id (an email, a ticket number, a version), 1 to 1024 characters.
|
|
11
|
+
|
|
12
|
+
A memory also has an \`id\` (\`[a-z][a-z0-9_-]{0,63}\`) and a \`description\` (1 to 500 characters) set at creation.
|
|
13
|
+
|
|
14
|
+
## Create and attach
|
|
15
|
+
|
|
16
|
+
1. Create the memory first: console **Memories**, or \`create_memory\` with \`id\` and \`description\`. The cover starts empty.
|
|
17
|
+
2. Attach it:
|
|
18
|
+
- to a **pipeline** with the top-level \`memories: [id]\` list (tool: \`edit_pipeline\` with \`patch: { memories: [...] }\`; an empty list removes it). Every stage in that pipeline gets it. A stage cannot list memories of its own (\`pipeline.invalid_shape\`).
|
|
19
|
+
- to an **agent** with its \`memories: [id]\` field (tool: \`save_agent\`). Sub-agents do not inherit it.
|
|
20
|
+
3. A missing, unreadable or mismatched id blocks validation and run start (\`pipeline.memory_unavailable\`) or agent save and enable (\`agent.memory_unavailable\`). A duplicate id in the list is \`pipeline.invalid_memories\`.
|
|
21
|
+
|
|
22
|
+
## What a session gets
|
|
23
|
+
|
|
24
|
+
A stage of a pipeline with memories (Pi backend) and every session of an agent with memories get six tools:
|
|
25
|
+
|
|
26
|
+
- \`read_memory\`, \`replace_memory\` for the cover;
|
|
27
|
+
- \`add_memory_card\` (refuses a key that exists), \`update_memory_card\` (refuses a key that is missing), \`read_memory_card\`, \`search_memory_cards\` (case-insensitive word scan of keys and bodies, at most 20 hits, key plus snippet).
|
|
28
|
+
|
|
29
|
+
The prompt lists only the memory ids and descriptions, not the cover or card text; the session must read them with the tools. The session never gets a file path, and Pi stages with memories are blocked from reaching the memory store through the shell. A session cannot delete a card and cannot read a previous copy. The Claude backend has no memory tools: a pipeline with \`memories\` fails at stage start there.
|
|
30
|
+
|
|
31
|
+
## Caps
|
|
32
|
+
|
|
33
|
+
- Cover and each card: at most 64,000 characters. A larger write is refused (\`MEMORY_TOO_LARGE\`).
|
|
34
|
+
- At most 200 cards per memory (\`MEMORY_TOO_MANY_CARDS\`).
|
|
35
|
+
- Two cover replacements at the same time: the last write wins.
|
|
36
|
+
- One previous copy of the cover and of each card is kept, not a full history, and there is no restore action.
|
|
37
|
+
|
|
38
|
+
## What people and tools can do
|
|
39
|
+
|
|
40
|
+
| Action | Session (stage or agent) | Operator in console | Guide / operator tools |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| Create a memory | no | yes | \`create_memory\` |
|
|
43
|
+
| Read cover and card keys | yes | yes | \`get_memory\`, \`list_memories\` |
|
|
44
|
+
| Replace the cover | yes | yes | \`write_memory\` |
|
|
45
|
+
| Add a new card | yes | no | no |
|
|
46
|
+
| Replace an existing card | yes | yes | \`write_memory_card\` (refuses a missing card) |
|
|
47
|
+
| Delete a card | no | yes (also removes its previous copy; cannot be undone) | \`delete_memory_card\` (destructive) |
|
|
48
|
+
| Change the description | no | no | no |
|
|
49
|
+
| Delete a whole memory | no | no | no |
|
|
50
|
+
|
|
51
|
+
So cards are written by the sessions that do the work. To seed facts before the first run, put them on the cover page, or let the first run add cards.
|
|
52
|
+
|
|
53
|
+
## Memory or task context?
|
|
54
|
+
|
|
55
|
+
- Facts for one run go in the task (\`context\`, \`constraints\`, \`input\`).
|
|
56
|
+
- Facts that must persist and be updated across runs or conversations go in a memory: contacts already messaged, per-customer notes, release history.
|
|
57
|
+
- Name the memory and write a clear description: it is all the session sees before it calls a tool.
|
|
58
|
+
|
|
59
|
+
## Error codes
|
|
60
|
+
|
|
61
|
+
\`MEMORY_INVALID_ID\`, \`MEMORY_INVALID_DESCRIPTION\`, \`MEMORY_INVALID_KEY\`, \`MEMORY_EXISTS\`, \`MEMORY_NOT_FOUND\`, \`MEMORY_NO_PREVIOUS\`, \`MEMORY_CARD_EXISTS\`, \`MEMORY_CARD_NOT_FOUND\`, \`MEMORY_TOO_MANY_CARDS\`, \`MEMORY_MISMATCH\`, \`MEMORY_UNREADABLE\`, \`MEMORY_TOO_LARGE\`, \`MEMORY_NOT_ATTACHED\`.
|
|
62
|
+
`,
|
|
63
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const modelsAndProvidersTopic = {
|
|
2
|
+
id: "models_and_providers",
|
|
3
|
+
title: "Models and providers",
|
|
4
|
+
summary: "How a stage's model is resolved (stage, pipeline, stageflow.yaml), what must be connected before a run works, model ids and the catalog, agent and eval models, and where credentials live.",
|
|
5
|
+
body: `# Models and providers
|
|
6
|
+
|
|
7
|
+
Stages and agents run on **Pi**. A model id is \`provider/model\` (for example \`anthropic/claude-sonnet-4-5\` or \`openrouter/…\`). A provider must be connected on the Host before runs that use it can succeed.
|
|
8
|
+
|
|
9
|
+
## Connecting a provider
|
|
10
|
+
|
|
11
|
+
- Console: **Settings → Providers**, or the **Connect** page (\`#/connect\`). API key or OAuth, depending on the provider.
|
|
12
|
+
- CLI: \`sf providers login <id> --type api_key --api-key-env VAR\` (raw keys on the command line are refused), \`sf providers status\`.
|
|
13
|
+
- At Host boot: \`STAGEFLOW_PROVIDER_<ID>_API_KEY\` or \`_FILE\`. The Host writes this key back at every boot, so it returns after a restart even if someone disconnected the provider in the console.
|
|
14
|
+
- Credentials live in \`<credential root>/agent/auth.json\` (default \`~/.stageflow/agent/auth.json\`). They are never put into a stage's environment.
|
|
15
|
+
- There is no tool to log in, log out or add a provider key. Guide can only look: \`list_providers\`, \`list_models\`, \`get_health\`.
|
|
16
|
+
|
|
17
|
+
## How a stage's model is chosen
|
|
18
|
+
|
|
19
|
+
Resolved at pipeline load:
|
|
20
|
+
|
|
21
|
+
\`\`\`text
|
|
22
|
+
stage.model ?? pipeline.model ?? stageflow.yaml model
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
- Pipeline \`model\` is read only from the root pipeline file, not from included fragments. When it fills a stage, \`validate\` warns \`pipeline.model_applies\` (just information).
|
|
26
|
+
- If all three are empty, the pipeline does not load: "model is required (set on stage, pipeline, or stageflow.yaml)". There is no silent fallback for stages.
|
|
27
|
+
- Validation does not check that the provider is connected. A missing key shows up when the run starts.
|
|
28
|
+
- \`agent\` (pipeline or manifest) picks the backend, \`pi\` by default. It is separate from \`model\`. The Claude backend lacks \`send_message\` and memory tools.
|
|
29
|
+
- \`create_stage\` without a \`model\` writes the Host's current default model into the new stage file, so that stage no longer follows a pipeline default. Pass the model you want. \`edit_stage\` merges fields and cannot remove one; to let the pipeline default apply, rewrite the stage file without \`model\` using \`write_catalog_file\`.
|
|
30
|
+
|
|
31
|
+
## The model catalog
|
|
32
|
+
|
|
33
|
+
One catalog feeds every picker, \`list_models\` and the default model.
|
|
34
|
+
|
|
35
|
+
- Only connected providers appear. Lists are fetched live and cached for 30 seconds, with a built-in fallback when a provider is unreachable.
|
|
36
|
+
- Any \`provider/model\` id can be typed; an id no connected provider lists is saved and runs as written, with a warning.
|
|
37
|
+
- The catalog default (used by pickers, by \`create_stage\`, and by the Workshop) is: \`stageflow.yaml\` \`model\`, then the Workshop model in Settings, then the catalog's pick (a free OpenRouter model when connected, else the first free model, else the first model; never a Cursor model while another exists). This does not change stage resolution above.
|
|
38
|
+
- Cursor models (\`cursor/…\`) need a Cursor API key. Agents refuse Cursor models unless the Host sets \`STAGEFLOW_AGENTS_ALLOW_CURSOR_NATIVE_TOOLS=1\`, because Cursor runs its own file and shell tools and grants cannot hold (\`agent.model_native_tools\`).
|
|
39
|
+
|
|
40
|
+
## Agents
|
|
41
|
+
|
|
42
|
+
\`model: { backend: pi, id, thinking }\`. \`id\` defaults to the project default model. \`thinking\` is \`off\`, \`low\`, \`medium\` (default) or \`high\` for models that support it. An unknown id only warns (\`agent.model_unknown\`).
|
|
43
|
+
|
|
44
|
+
## Evals
|
|
45
|
+
|
|
46
|
+
The stage or agent may use any provider. Judges and the agent simulator must be \`anthropic\`, \`openai\` or \`openrouter\` with an API key (OAuth logins cannot judge). The eval's \`defaults.model\` (or a run override) replaces the target's model for that eval.
|
|
47
|
+
|
|
48
|
+
## Workshop chat model
|
|
49
|
+
|
|
50
|
+
A new Workshop chat uses \`stageflow.yaml\` \`model\`, then the Settings Workshop model, then \`cursor/auto\`.
|
|
51
|
+
|
|
52
|
+
## Cost
|
|
53
|
+
|
|
54
|
+
Run and agent cost come from provider token reports. A provider that reports no cost adds nothing to totals. Overview "spend" sums stage attempt costs. Agent \`limits.cost_usd\` and eval \`max_cost_usd\` are the cost brakes; pipelines have no run-level cost cap field.
|
|
55
|
+
`,
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const overviewTopic = {
|
|
2
|
+
id: "overview",
|
|
3
|
+
title: "Building blocks and which one to pick",
|
|
4
|
+
summary: "What pipelines, stages, tasks, agents, triggers, connections, memories, MCP, skills and evals are, how they relate, and how to choose between them.",
|
|
5
|
+
body: `# Building blocks and which one to pick
|
|
6
|
+
|
|
7
|
+
Stageflow runs configurable multi-stage workflows and project agents, with a local console. Work can be anything repeated: releases, research, content review, operations runbooks, support, software changes. Nothing in the product is tied to one domain.
|
|
8
|
+
|
|
9
|
+
## The pieces
|
|
10
|
+
|
|
11
|
+
- **Pipeline** (\`*.pipeline.yaml\`). An ordered graph of stages. Each stage runs in a fresh agent session, does one job and hands a typed result (an envelope) to the next stage. Wiring is declared on the source stage with \`route\`.
|
|
12
|
+
- **Stage**. One step of a pipeline: a system prompt, a model, a required input and output schema (\`io\`), and optional checks (\`verify\`), questions to a person (\`gate_kinds\`), tools (MCP, skill, browser), a send channel and secrets. A stage can live inline in the pipeline file or in its own YAML file referenced with \`uses:\`.
|
|
13
|
+
- **Task** (\`*.task.yaml\`). The input a pipeline run starts from: \`id\`, \`goal\`, optional \`context\`, \`constraints\`, \`input\` (structured data for the entry stage) and an optional working folder or repository. A run is always one pipeline plus one task.
|
|
14
|
+
- **Run**. One execution of a pipeline with a task. Runs are stored on the Host under \`$STAGEFLOW_HOME\` (default \`~/.stageflow/\`), not in the project.
|
|
15
|
+
- **Agent** (\`agents/<id>.agent.yaml\`). A configured assistant that holds a conversation over many turns: instructions, a model, the tools it may use, ask-first approvals, limits, and how people reach it (console, public web chat page, one inbound channel, or a schedule).
|
|
16
|
+
- **Trigger** (\`*.trigger.yaml\`). Starts a pipeline run without someone clicking. Kinds: \`manual\` (fired on request), \`schedule\` (cron), \`event\` (GitHub pull requests, a signed webhook, or an IMAP mailbox).
|
|
17
|
+
- **Connection**. A host-level link to a messaging provider (AgentMail, Slack, Telegram, iMessage via Photon, WhatsApp via Photon). A stage uses it to send one message to a recipient fixed in YAML. An agent can also answer on it.
|
|
18
|
+
- **Memory**. A named store on the Host with a cover page and keyed cards. Attached to a whole pipeline (every stage gets it) or to an agent. Sessions read and write it with memory tools.
|
|
19
|
+
- **MCP servers and skills**. Extra tools for a stage or an agent: MCP servers from the project \`.mcp.json\` or saved in the console, and installed skills.
|
|
20
|
+
- **Eval** (\`evals/<id>.eval.yaml\`) with a **dataset**. Runs one stage or one agent over many cases, grades each output, repeats each case, and compares runs.
|
|
21
|
+
|
|
22
|
+
## How they relate
|
|
23
|
+
|
|
24
|
+
A trigger points at a pipeline and (usually) a task. The pipeline's stages may list MCP servers, a skill, a browser profile, one channel and secrets. The pipeline may attach memories. An eval points at one stage or one agent plus a dataset. An agent may list MCP tools, skills, Stageflow tools, sub-agents, memories and one connection.
|
|
25
|
+
|
|
26
|
+
## Which one to pick
|
|
27
|
+
|
|
28
|
+
**Pipeline vs agent**
|
|
29
|
+
- Pick a **pipeline** when the work has known steps in a fixed order, each step can be described with an input and an output, and you want checks between steps. Runs are repeatable and inspectable stage by stage.
|
|
30
|
+
- Pick an **agent** when someone needs to talk back and forth, the next step depends on the conversation, or people should reach it by chat, email, Slack, Telegram, iMessage or a web page.
|
|
31
|
+
- An agent can start pipeline runs if it is granted the \`runs.control\` tool group (\`start_run\`), so a conversational front end can hand fixed work to a pipeline.
|
|
32
|
+
|
|
33
|
+
**One stage vs many stages**
|
|
34
|
+
- Start with a one-stage pipeline when the job is a single step. Split into stages when a step has its own clear output, needs a different model or tools, needs a person to approve before continuing, or should be checked on its own.
|
|
35
|
+
- Many small stages cost more model sessions; one huge stage is hard to check and to recover.
|
|
36
|
+
|
|
37
|
+
**Task vs trigger**
|
|
38
|
+
- A **task** is what to do. A **trigger** is when to do it. You always need a pipeline; you need a catalog task for anything started from the console's Start a run, for a manual trigger fired from the console, and for a schedule trigger.
|
|
39
|
+
- A trigger without a task (dynamic mode) only works when whoever fires it supplies the task: GitHub, webhook and email adapters build one from the event, or a manual fire passes one inline.
|
|
40
|
+
|
|
41
|
+
**Memory vs task context**
|
|
42
|
+
- Put facts for one run in the task (\`context\`, \`constraints\`, \`input\`).
|
|
43
|
+
- Use a **memory** when facts must survive across runs or conversations and be updated by the sessions themselves (a contact list, per-ticket notes, what was already sent).
|
|
44
|
+
|
|
45
|
+
**Connection vs MCP**
|
|
46
|
+
- Use a **connection** when a stage should notify someone and the recipient must be fixed. The agent cannot change the recipient.
|
|
47
|
+
- Use an **MCP server** when the stage or agent must read or act in another system (an issue tracker, docs, a database).
|
|
48
|
+
|
|
49
|
+
**Eval**
|
|
50
|
+
- Add an eval when a wrong answer is costly or you are about to change a prompt, model or tools and want to know if it got better or worse.
|
|
51
|
+
|
|
52
|
+
## Who can do what
|
|
53
|
+
|
|
54
|
+
Guide and other agents can create and edit almost everything with tools. Only a person can answer a pipeline gate, decide a feedback loop at its limit, or approve or deny an agent's ask-first action (tool group \`gates.decide\` is operator-only).
|
|
55
|
+
`,
|
|
56
|
+
};
|