patchwork-os 0.2.0-beta.10.canary.98 → 0.2.0-beta.11
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 +20 -1
- package/dist/adapters/grok.js +6 -1
- package/dist/adapters/grok.js.map +1 -1
- package/dist/approvalHttp.js +61 -66
- package/dist/approvalHttp.js.map +1 -1
- package/dist/bridge.js +3 -2
- package/dist/bridge.js.map +1 -1
- package/dist/claudeOrchestrator.js +15 -0
- package/dist/claudeOrchestrator.js.map +1 -1
- package/dist/commands/connect.d.ts +47 -0
- package/dist/commands/connect.js +419 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/patchworkInit.d.ts +7 -0
- package/dist/commands/patchworkInit.js +26 -0
- package/dist/commands/patchworkInit.js.map +1 -1
- package/dist/commands/recipe.d.ts +14 -0
- package/dist/commands/recipe.js +51 -0
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/recipeInstall.js +15 -0
- package/dist/commands/recipeInstall.js.map +1 -1
- package/dist/connectors/postgres.d.ts +7 -0
- package/dist/connectors/postgres.js +16 -2
- package/dist/connectors/postgres.js.map +1 -1
- package/dist/connectors/snowflake.js +6 -0
- package/dist/connectors/snowflake.js.map +1 -1
- package/dist/connectors/tokenStorage.d.ts +8 -0
- package/dist/connectors/tokenStorage.js +42 -3
- package/dist/connectors/tokenStorage.js.map +1 -1
- package/dist/drivers/claude/api.js +15 -2
- package/dist/drivers/claude/api.js.map +1 -1
- package/dist/drivers/claude/subprocess.js +1 -29
- package/dist/drivers/claude/subprocess.js.map +1 -1
- package/dist/drivers/gemini/index.js +9 -5
- package/dist/drivers/gemini/index.js.map +1 -1
- package/dist/drivers/openai/index.js +29 -4
- package/dist/drivers/openai/index.js.map +1 -1
- package/dist/drivers/outputCap.d.ts +27 -0
- package/dist/drivers/outputCap.js +50 -0
- package/dist/drivers/outputCap.js.map +1 -0
- package/dist/featureFlags.d.ts +9 -0
- package/dist/featureFlags.js +16 -0
- package/dist/featureFlags.js.map +1 -1
- package/dist/fp/commandDescription.d.ts +6 -0
- package/dist/fp/commandDescription.js +4 -4
- package/dist/fp/commandDescription.js.map +1 -1
- package/dist/fp/policyParser.js +13 -7
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/haltPushDispatch.js +7 -22
- package/dist/haltPushDispatch.js.map +1 -1
- package/dist/index.js +148 -0
- package/dist/index.js.map +1 -1
- package/dist/mcpRoutes.js +1 -1
- package/dist/mcpRoutes.js.map +1 -1
- package/dist/oauth.d.ts +13 -0
- package/dist/oauth.js +34 -1
- package/dist/oauth.js.map +1 -1
- package/dist/recipeOrchestration.js +10 -0
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/recipeRoutes.d.ts +39 -0
- package/dist/recipeRoutes.js +214 -12
- package/dist/recipeRoutes.js.map +1 -1
- package/dist/recipes/agentExecutor.d.ts +20 -0
- package/dist/recipes/agentExecutor.js +32 -10
- package/dist/recipes/agentExecutor.js.map +1 -1
- package/dist/recipes/chainedRunner.d.ts +41 -2
- package/dist/recipes/chainedRunner.js +134 -6
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/connectorPreflight.js +30 -0
- package/dist/recipes/connectorPreflight.js.map +1 -1
- package/dist/recipes/haltCategory.d.ts +5 -0
- package/dist/recipes/haltCategory.js +7 -1
- package/dist/recipes/haltCategory.js.map +1 -1
- package/dist/recipes/judgeVerdict.d.ts +10 -0
- package/dist/recipes/judgeVerdict.js +10 -0
- package/dist/recipes/judgeVerdict.js.map +1 -1
- package/dist/recipes/names.d.ts +5 -0
- package/dist/recipes/names.js +10 -5
- package/dist/recipes/names.js.map +1 -1
- package/dist/recipes/parser.js +32 -9
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/pricing/costRouter.d.ts +43 -0
- package/dist/recipes/pricing/costRouter.js +44 -0
- package/dist/recipes/pricing/costRouter.js.map +1 -0
- package/dist/recipes/pricing/priceTable.d.ts +76 -0
- package/dist/recipes/pricing/priceTable.js +144 -0
- package/dist/recipes/pricing/priceTable.js.map +1 -0
- package/dist/recipes/runBudget.d.ts +82 -32
- package/dist/recipes/runBudget.js +182 -49
- package/dist/recipes/runBudget.js.map +1 -1
- package/dist/recipes/schema.d.ts +25 -4
- package/dist/recipes/schemaGenerator.d.ts +9 -0
- package/dist/recipes/schemaGenerator.js +386 -75
- package/dist/recipes/schemaGenerator.js.map +1 -1
- package/dist/recipes/simulation/aggregateRunRisk.d.ts +43 -0
- package/dist/recipes/simulation/aggregateRunRisk.js +117 -0
- package/dist/recipes/simulation/aggregateRunRisk.js.map +1 -0
- package/dist/recipes/simulation/costProjector.d.ts +32 -0
- package/dist/recipes/simulation/costProjector.js +194 -0
- package/dist/recipes/simulation/costProjector.js.map +1 -0
- package/dist/recipes/simulation/sideEffects.d.ts +32 -0
- package/dist/recipes/simulation/sideEffects.js +62 -0
- package/dist/recipes/simulation/sideEffects.js.map +1 -0
- package/dist/recipes/simulation/simulate.d.ts +36 -0
- package/dist/recipes/simulation/simulate.js +264 -0
- package/dist/recipes/simulation/simulate.js.map +1 -0
- package/dist/recipes/simulation/simulateMockedRun.d.ts +52 -0
- package/dist/recipes/simulation/simulateMockedRun.js +72 -0
- package/dist/recipes/simulation/simulateMockedRun.js.map +1 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.d.ts +31 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.js +50 -0
- package/dist/recipes/simulation/synthesizeMockedOutputs.js.map +1 -0
- package/dist/recipes/simulation/types.d.ts +198 -0
- package/dist/recipes/simulation/types.js +30 -0
- package/dist/recipes/simulation/types.js.map +1 -0
- package/dist/recipes/stepObservation.d.ts +12 -0
- package/dist/recipes/stepObservation.js +21 -1
- package/dist/recipes/stepObservation.js.map +1 -1
- package/dist/recipes/tools/airtable.d.ts +15 -0
- package/dist/recipes/tools/airtable.js +240 -0
- package/dist/recipes/tools/airtable.js.map +1 -0
- package/dist/recipes/tools/caldiy.d.ts +13 -0
- package/dist/recipes/tools/caldiy.js +214 -0
- package/dist/recipes/tools/caldiy.js.map +1 -0
- package/dist/recipes/tools/circleci.d.ts +10 -0
- package/dist/recipes/tools/circleci.js +204 -0
- package/dist/recipes/tools/circleci.js.map +1 -0
- package/dist/recipes/tools/cloudflare.d.ts +13 -0
- package/dist/recipes/tools/cloudflare.js +211 -0
- package/dist/recipes/tools/cloudflare.js.map +1 -0
- package/dist/recipes/tools/docs.d.ts +18 -0
- package/dist/recipes/tools/docs.js +94 -0
- package/dist/recipes/tools/docs.js.map +1 -0
- package/dist/recipes/tools/elasticsearch.d.ts +11 -0
- package/dist/recipes/tools/elasticsearch.js +156 -0
- package/dist/recipes/tools/elasticsearch.js.map +1 -0
- package/dist/recipes/tools/figma.d.ts +12 -0
- package/dist/recipes/tools/figma.js +194 -0
- package/dist/recipes/tools/figma.js.map +1 -0
- package/dist/recipes/tools/grafana.d.ts +11 -0
- package/dist/recipes/tools/grafana.js +216 -0
- package/dist/recipes/tools/grafana.js.map +1 -0
- package/dist/recipes/tools/http.d.ts +1 -1
- package/dist/recipes/tools/http.js +10 -28
- package/dist/recipes/tools/http.js.map +1 -1
- package/dist/recipes/tools/index.d.ts +26 -0
- package/dist/recipes/tools/index.js +26 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/monday.d.ts +22 -0
- package/dist/recipes/tools/monday.js +242 -0
- package/dist/recipes/tools/monday.js.map +1 -0
- package/dist/recipes/tools/obsidian.d.ts +15 -0
- package/dist/recipes/tools/obsidian.js +172 -0
- package/dist/recipes/tools/obsidian.js.map +1 -0
- package/dist/recipes/tools/paystack.d.ts +11 -0
- package/dist/recipes/tools/paystack.js +211 -0
- package/dist/recipes/tools/paystack.js.map +1 -0
- package/dist/recipes/tools/pipedrive.d.ts +16 -0
- package/dist/recipes/tools/pipedrive.js +233 -0
- package/dist/recipes/tools/pipedrive.js.map +1 -0
- package/dist/recipes/tools/postgres.d.ts +15 -0
- package/dist/recipes/tools/postgres.js +185 -0
- package/dist/recipes/tools/postgres.js.map +1 -0
- package/dist/recipes/tools/posthog.d.ts +16 -0
- package/dist/recipes/tools/posthog.js +219 -0
- package/dist/recipes/tools/posthog.js.map +1 -0
- package/dist/recipes/tools/redis.d.ts +9 -0
- package/dist/recipes/tools/redis.js +140 -0
- package/dist/recipes/tools/redis.js.map +1 -0
- package/dist/recipes/tools/resend.d.ts +8 -0
- package/dist/recipes/tools/resend.js +153 -0
- package/dist/recipes/tools/resend.js.map +1 -0
- package/dist/recipes/tools/salesforce.d.ts +16 -0
- package/dist/recipes/tools/salesforce.js +184 -0
- package/dist/recipes/tools/salesforce.js.map +1 -0
- package/dist/recipes/tools/sendgrid.d.ts +9 -0
- package/dist/recipes/tools/sendgrid.js +174 -0
- package/dist/recipes/tools/sendgrid.js.map +1 -0
- package/dist/recipes/tools/shopify.d.ts +16 -0
- package/dist/recipes/tools/shopify.js +265 -0
- package/dist/recipes/tools/shopify.js.map +1 -0
- package/dist/recipes/tools/snowflake.d.ts +16 -0
- package/dist/recipes/tools/snowflake.js +173 -0
- package/dist/recipes/tools/snowflake.js.map +1 -0
- package/dist/recipes/tools/stripe.js +13 -12
- package/dist/recipes/tools/stripe.js.map +1 -1
- package/dist/recipes/tools/supabase.d.ts +9 -0
- package/dist/recipes/tools/supabase.js +132 -0
- package/dist/recipes/tools/supabase.js.map +1 -0
- package/dist/recipes/tools/todoist.d.ts +15 -0
- package/dist/recipes/tools/todoist.js +227 -0
- package/dist/recipes/tools/todoist.js.map +1 -0
- package/dist/recipes/tools/twilio.d.ts +11 -0
- package/dist/recipes/tools/twilio.js +180 -0
- package/dist/recipes/tools/twilio.js.map +1 -0
- package/dist/recipes/tools/vercel.d.ts +9 -0
- package/dist/recipes/tools/vercel.js +145 -0
- package/dist/recipes/tools/vercel.js.map +1 -0
- package/dist/recipes/tools/webflow.d.ts +11 -0
- package/dist/recipes/tools/webflow.js +243 -0
- package/dist/recipes/tools/webflow.js.map +1 -0
- package/dist/recipes/tools/woocommerce.d.ts +18 -0
- package/dist/recipes/tools/woocommerce.js +259 -0
- package/dist/recipes/tools/woocommerce.js.map +1 -0
- package/dist/recipes/tools/wrapConnectorExecute.d.ts +25 -0
- package/dist/recipes/tools/wrapConnectorExecute.js +37 -0
- package/dist/recipes/tools/wrapConnectorExecute.js.map +1 -0
- package/dist/recipes/validation.js +264 -0
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/yamlRunner.d.ts +112 -3
- package/dist/recipes/yamlRunner.js +482 -19
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/runLog.d.ts +46 -0
- package/dist/runLog.js +4 -0
- package/dist/runLog.js.map +1 -1
- package/dist/schemas/recipe.v1.json +217 -11
- package/dist/server.d.ts +3 -0
- package/dist/server.js +4 -0
- package/dist/server.js.map +1 -1
- package/dist/streamableHttp.js +3 -2
- package/dist/streamableHttp.js.map +1 -1
- package/dist/tools/gitWrite.js +5 -1
- package/dist/tools/gitWrite.js.map +1 -1
- package/dist/tools/terminal.js +15 -49
- package/dist/tools/terminal.js.map +1 -1
- package/dist/transport.d.ts +1 -0
- package/dist/transport.js +7 -0
- package/dist/transport.js.map +1 -1
- package/package.json +3 -3
- package/scripts/mcp-stdio-shim.cjs +218 -84
- package/templates/recipes/incident-to-pr.yaml +187 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What-If Preview — types for the static counterfactual simulation of a recipe.
|
|
3
|
+
*
|
|
4
|
+
* P0 ("static" fidelity): the report is a pure, honest superset of the
|
|
5
|
+
* dry-run plan (`RecipeDryRunPlan`). It NEVER executes a step. Every field is
|
|
6
|
+
* derived from the static plan + tool-registry metadata, so the report cannot
|
|
7
|
+
* make a real external call, write a file, or spend a token.
|
|
8
|
+
*
|
|
9
|
+
* Design constraints baked into the shape (from the 2026-06-04 investigation,
|
|
10
|
+
* `docs/counterfactual-sim-engine-investigation.md`):
|
|
11
|
+
* - `gatedOnRecipeSteps` is a first-class boolean so a consumer can NEVER
|
|
12
|
+
* imply an approval gate that does not exist on the recipe execution path
|
|
13
|
+
* today (the live gate in transport.ts only gates MCP bridge calls).
|
|
14
|
+
* - cost carries an explicit `basis` and is never a precise dollar figure or
|
|
15
|
+
* `$0` — at static fidelity USD is genuinely not projectable.
|
|
16
|
+
* - conditional branches resolve to `"undetermined"`, never a faked
|
|
17
|
+
* taken/skipped, because dry-run sentinels are truthy and would lie.
|
|
18
|
+
*
|
|
19
|
+
* Later phases bump `fidelity` ("mocked" | "hybrid") and `schemaVersion`.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Stable schema version for consumers; bump on breaking shape changes.
|
|
23
|
+
*
|
|
24
|
+
* v2 (P2 mocked sandbox): adds `fidelity:"mocked"`, `SimulationStep.mockedFrom`,
|
|
25
|
+
* and the `taken`/`skipped` branch outcomes (alongside the existing
|
|
26
|
+
* `undetermined`). All additions are additive/back-compatible — a static report
|
|
27
|
+
* is still a valid v2 report.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SIMULATION_SCHEMA_VERSION = 2;
|
|
30
|
+
export type RiskTier = "low" | "medium" | "high";
|
|
31
|
+
/**
|
|
32
|
+
* Side-effect class for a single step, derived from registry metadata
|
|
33
|
+
* (`isWrite` / `isConnector` / `namespace`) — never from execution.
|
|
34
|
+
*/
|
|
35
|
+
export type SideEffectKind = "local-read" | "local-write" | "connector-read" | "connector-write" | "external-http" | "agent-llm" | "nested-recipe" | "unknown";
|
|
36
|
+
export interface SimulationStep {
|
|
37
|
+
id: string;
|
|
38
|
+
type: "tool" | "agent" | "recipe";
|
|
39
|
+
tool?: string;
|
|
40
|
+
namespace?: string;
|
|
41
|
+
/** True when the tool id resolved in the registry at plan time. */
|
|
42
|
+
resolved: boolean;
|
|
43
|
+
optional?: boolean;
|
|
44
|
+
dependencies?: string[];
|
|
45
|
+
/** Present for chained steps with a `when:` condition. */
|
|
46
|
+
condition?: string;
|
|
47
|
+
/** The step's own risk (explicit on the step, or the registry default). */
|
|
48
|
+
baseRisk: RiskTier;
|
|
49
|
+
/**
|
|
50
|
+
* Risk including blast-radius propagation: at least as high as the highest
|
|
51
|
+
* risk among the steps that must have run before this one (its transitive
|
|
52
|
+
* dependencies). Equals `baseRisk` when nothing higher-risk precedes it.
|
|
53
|
+
*/
|
|
54
|
+
effectiveRisk: RiskTier;
|
|
55
|
+
sideEffect: SideEffectKind;
|
|
56
|
+
isWrite: boolean;
|
|
57
|
+
isConnector: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* P2 mocked fidelity only. Present when the report is `fidelity:"mocked"`:
|
|
60
|
+
* `"history"` → this step's output was taken from a real prior run;
|
|
61
|
+
* `"synthesized"` → no history existed, so the mocked sandbox fed the step a
|
|
62
|
+
* synthesized placeholder (still executing nothing for real). Absent at
|
|
63
|
+
* static fidelity.
|
|
64
|
+
*/
|
|
65
|
+
mockedFrom?: "history" | "synthesized";
|
|
66
|
+
}
|
|
67
|
+
/** Per-step approval projection — "what WOULD gate, if recipe steps were gated". */
|
|
68
|
+
export interface ApprovalProjection {
|
|
69
|
+
stepId: string;
|
|
70
|
+
tool?: string;
|
|
71
|
+
tier: RiskTier;
|
|
72
|
+
/** True if this step's tier would trip an approval gate (tier !== "low"). */
|
|
73
|
+
wouldRequireApproval: boolean;
|
|
74
|
+
reason: string;
|
|
75
|
+
}
|
|
76
|
+
/** A conditional branch surfaced by the engine. */
|
|
77
|
+
export interface BranchProjection {
|
|
78
|
+
stepId: string;
|
|
79
|
+
condition: string;
|
|
80
|
+
/**
|
|
81
|
+
* At static fidelity always `"undetermined"` — sentinels would lie.
|
|
82
|
+
* At mocked fidelity (P2): `"taken"` / `"skipped"` when every step id the
|
|
83
|
+
* `when:` references has a real historical value (so the condition resolves
|
|
84
|
+
* realistically), else `"undetermined"`.
|
|
85
|
+
*/
|
|
86
|
+
outcome: "taken" | "skipped" | "undetermined";
|
|
87
|
+
reason: string;
|
|
88
|
+
}
|
|
89
|
+
export interface RiskComponents {
|
|
90
|
+
highSteps: number;
|
|
91
|
+
mediumSteps: number;
|
|
92
|
+
writeSteps: number;
|
|
93
|
+
connectorWriteSteps: number;
|
|
94
|
+
externalHttpSteps: number;
|
|
95
|
+
unresolvedSteps: number;
|
|
96
|
+
}
|
|
97
|
+
export interface RunRiskSummary {
|
|
98
|
+
/** 0–100 derived workflow risk score. Always shown WITH its components. */
|
|
99
|
+
score: number;
|
|
100
|
+
tier: RiskTier;
|
|
101
|
+
components: RiskComponents;
|
|
102
|
+
/** Highest single-step effective risk in the plan. */
|
|
103
|
+
highestStepRisk: RiskTier;
|
|
104
|
+
}
|
|
105
|
+
export interface SimulationCost {
|
|
106
|
+
/**
|
|
107
|
+
* "history": median of the P1 per-step token corpus (P3).
|
|
108
|
+
* "heuristic": a coarse chars/4 token estimate (no run history yet).
|
|
109
|
+
* "unavailable": no agent steps / nothing to estimate.
|
|
110
|
+
*/
|
|
111
|
+
basis: "history" | "heuristic" | "unavailable";
|
|
112
|
+
/**
|
|
113
|
+
* Loud confidence signal (P3). "high" only when every agent step has enough
|
|
114
|
+
* historical samples; "low" when some fall back to chars/4; "none" otherwise.
|
|
115
|
+
*/
|
|
116
|
+
confidence?: "high" | "low" | "none";
|
|
117
|
+
/** Prior runs that contributed at least one sample (history basis). */
|
|
118
|
+
sampleRuns?: number;
|
|
119
|
+
agentSteps: number;
|
|
120
|
+
/** Agent steps with any estimate (history or prompt-heuristic). */
|
|
121
|
+
estimatedAgentSteps: number;
|
|
122
|
+
/**
|
|
123
|
+
* Back-compat input-token proxy: chars/4 sum at static fidelity, or the
|
|
124
|
+
* median-summed input tokens once a history projection exists.
|
|
125
|
+
*/
|
|
126
|
+
estPromptTokens: number | null;
|
|
127
|
+
/** P3 — projected total input tokens (median-summed). */
|
|
128
|
+
estInputTokens?: number | null;
|
|
129
|
+
/** P3 — projected total output tokens (median-summed). */
|
|
130
|
+
estOutputTokens?: number | null;
|
|
131
|
+
/**
|
|
132
|
+
* Expected USD — sum of per-step median historical costUsd. null when there
|
|
133
|
+
* is no billable history (e.g. subscription/subprocess drivers); NEVER a $0
|
|
134
|
+
* placeholder. (Was always null pre-P3.)
|
|
135
|
+
*/
|
|
136
|
+
usd: number | null;
|
|
137
|
+
/** P3 — USD range across history (sum of per-step min/max). null when none. */
|
|
138
|
+
minUsd?: number | null;
|
|
139
|
+
maxUsd?: number | null;
|
|
140
|
+
/** P3 — agent steps whose projection used real history (vs chars/4). */
|
|
141
|
+
historyAgentSteps?: number;
|
|
142
|
+
note: string;
|
|
143
|
+
}
|
|
144
|
+
export interface SimulationSummary {
|
|
145
|
+
totalSteps: number;
|
|
146
|
+
writeSteps: number;
|
|
147
|
+
connectorSteps: number;
|
|
148
|
+
agentSteps: number;
|
|
149
|
+
unresolvedSteps: number;
|
|
150
|
+
sideEffectCounts: Record<SideEffectKind, number>;
|
|
151
|
+
connectorNamespaces: string[];
|
|
152
|
+
}
|
|
153
|
+
export interface RecipeSimulationReport {
|
|
154
|
+
schemaVersion: typeof SIMULATION_SCHEMA_VERSION;
|
|
155
|
+
kind: "what-if-preview";
|
|
156
|
+
recipe: string;
|
|
157
|
+
triggerType: string;
|
|
158
|
+
/** ISO-8601 generation timestamp. */
|
|
159
|
+
generatedAt: string;
|
|
160
|
+
/**
|
|
161
|
+
* Simulation fidelity. `"static"` (P0): pure transform of the dry-run plan,
|
|
162
|
+
* nothing executed. `"mocked"` (P2): a chained recipe WITH run history driven
|
|
163
|
+
* through the real chained runner with history-backed `mockedOutputs` +
|
|
164
|
+
* fully-stubbed deps — still zero real I/O, but downstream templates and
|
|
165
|
+
* `when:` branches resolve realistically.
|
|
166
|
+
*/
|
|
167
|
+
fidelity: "static" | "mocked";
|
|
168
|
+
/**
|
|
169
|
+
* P2 mocked fidelity only — number of prior runs sampled to synthesize the
|
|
170
|
+
* mocked outputs. Absent at static fidelity.
|
|
171
|
+
*/
|
|
172
|
+
sampleRuns?: number;
|
|
173
|
+
/** "chained" recipes have a real DAG; "flat" recipes are a linear list. */
|
|
174
|
+
topology: "chained" | "flat";
|
|
175
|
+
/**
|
|
176
|
+
* CRITICAL honesty field. False today: the approval queue does NOT gate
|
|
177
|
+
* recipe-runner steps. Consumers MUST surface this so the approval
|
|
178
|
+
* projection is never read as live gate behaviour.
|
|
179
|
+
*/
|
|
180
|
+
gatedOnRecipeSteps: boolean;
|
|
181
|
+
steps: SimulationStep[];
|
|
182
|
+
summary: SimulationSummary;
|
|
183
|
+
risk: RunRiskSummary;
|
|
184
|
+
approvals: {
|
|
185
|
+
gatedOnRecipeSteps: boolean;
|
|
186
|
+
projected: ApprovalProjection[];
|
|
187
|
+
note: string;
|
|
188
|
+
};
|
|
189
|
+
cost: SimulationCost;
|
|
190
|
+
/** Conditional branches surfaced but not resolved (honest "rejected paths"). */
|
|
191
|
+
branches: BranchProjection[];
|
|
192
|
+
lint: {
|
|
193
|
+
errors: string[];
|
|
194
|
+
warnings: string[];
|
|
195
|
+
};
|
|
196
|
+
/** Loud, human-readable caveats about what this fidelity can and cannot show. */
|
|
197
|
+
notes: string[];
|
|
198
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What-If Preview — types for the static counterfactual simulation of a recipe.
|
|
3
|
+
*
|
|
4
|
+
* P0 ("static" fidelity): the report is a pure, honest superset of the
|
|
5
|
+
* dry-run plan (`RecipeDryRunPlan`). It NEVER executes a step. Every field is
|
|
6
|
+
* derived from the static plan + tool-registry metadata, so the report cannot
|
|
7
|
+
* make a real external call, write a file, or spend a token.
|
|
8
|
+
*
|
|
9
|
+
* Design constraints baked into the shape (from the 2026-06-04 investigation,
|
|
10
|
+
* `docs/counterfactual-sim-engine-investigation.md`):
|
|
11
|
+
* - `gatedOnRecipeSteps` is a first-class boolean so a consumer can NEVER
|
|
12
|
+
* imply an approval gate that does not exist on the recipe execution path
|
|
13
|
+
* today (the live gate in transport.ts only gates MCP bridge calls).
|
|
14
|
+
* - cost carries an explicit `basis` and is never a precise dollar figure or
|
|
15
|
+
* `$0` — at static fidelity USD is genuinely not projectable.
|
|
16
|
+
* - conditional branches resolve to `"undetermined"`, never a faked
|
|
17
|
+
* taken/skipped, because dry-run sentinels are truthy and would lie.
|
|
18
|
+
*
|
|
19
|
+
* Later phases bump `fidelity` ("mocked" | "hybrid") and `schemaVersion`.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Stable schema version for consumers; bump on breaking shape changes.
|
|
23
|
+
*
|
|
24
|
+
* v2 (P2 mocked sandbox): adds `fidelity:"mocked"`, `SimulationStep.mockedFrom`,
|
|
25
|
+
* and the `taken`/`skipped` branch outcomes (alongside the existing
|
|
26
|
+
* `undetermined`). All additions are additive/back-compatible — a static report
|
|
27
|
+
* is still a valid v2 report.
|
|
28
|
+
*/
|
|
29
|
+
export const SIMULATION_SCHEMA_VERSION = 2;
|
|
30
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/recipes/simulation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC"}
|
|
@@ -32,6 +32,18 @@ export interface SilentFailMatch {
|
|
|
32
32
|
* the runner doesn't already catch.
|
|
33
33
|
*/
|
|
34
34
|
export declare function detectSilentFail(result: unknown): SilentFailMatch | null;
|
|
35
|
+
export declare const REDACTED = "[REDACTED]";
|
|
36
|
+
/**
|
|
37
|
+
* Build a context copy in which the values of `secretKeys` (keys populated
|
|
38
|
+
* from a recipe-level `type: env` block) are replaced with the REDACTED
|
|
39
|
+
* marker. Used to render the LLM-facing agent prompt so an env-sourced
|
|
40
|
+
* secret never reaches the model verbatim. Tool-step param interpolation
|
|
41
|
+
* uses the ORIGINAL context — tools legitimately need the real value.
|
|
42
|
+
*
|
|
43
|
+
* Returns the input unchanged (same reference) when there are no secret
|
|
44
|
+
* keys, so the common no-secrets recipe path allocates nothing.
|
|
45
|
+
*/
|
|
46
|
+
export declare function redactSecretsForPrompt<T extends Record<string, string>>(ctx: T, secretKeys: ReadonlySet<string>): T;
|
|
35
47
|
/**
|
|
36
48
|
* Capture a value for inclusion in `RunStepResult`. Returns undefined if
|
|
37
49
|
* the value is `undefined` (don't bloat the log row for steps that
|
|
@@ -152,8 +152,28 @@ const SENSITIVE_KEY_PATTERNS = [
|
|
|
152
152
|
"access-token",
|
|
153
153
|
"access_token",
|
|
154
154
|
];
|
|
155
|
-
const REDACTED = "[REDACTED]";
|
|
155
|
+
export const REDACTED = "[REDACTED]";
|
|
156
156
|
const TRUNCATED = "[truncated]";
|
|
157
|
+
/**
|
|
158
|
+
* Build a context copy in which the values of `secretKeys` (keys populated
|
|
159
|
+
* from a recipe-level `type: env` block) are replaced with the REDACTED
|
|
160
|
+
* marker. Used to render the LLM-facing agent prompt so an env-sourced
|
|
161
|
+
* secret never reaches the model verbatim. Tool-step param interpolation
|
|
162
|
+
* uses the ORIGINAL context — tools legitimately need the real value.
|
|
163
|
+
*
|
|
164
|
+
* Returns the input unchanged (same reference) when there are no secret
|
|
165
|
+
* keys, so the common no-secrets recipe path allocates nothing.
|
|
166
|
+
*/
|
|
167
|
+
export function redactSecretsForPrompt(ctx, secretKeys) {
|
|
168
|
+
if (secretKeys.size === 0)
|
|
169
|
+
return ctx;
|
|
170
|
+
const out = { ...ctx };
|
|
171
|
+
for (const key of secretKeys) {
|
|
172
|
+
if (Object.hasOwn(out, key))
|
|
173
|
+
out[key] = REDACTED;
|
|
174
|
+
}
|
|
175
|
+
return out;
|
|
176
|
+
}
|
|
157
177
|
function isSensitiveKey(key) {
|
|
158
178
|
const lower = key.toLowerCase();
|
|
159
179
|
for (const pattern of SENSITIVE_KEY_PATTERNS) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepObservation.js","sourceRoot":"","sources":["../../src/recipes/stepObservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;A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I,CAAC;AAE3B,wEAAwE;AACxE,sEAAsE;AACtE,2BAA2B;AAC3B,MAAM,sBAAsB,GAAG;IAC7B,eAAe;IACf,WAAW;IACX,SAAS;IACT,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;IACT,aAAa;IACb,YAAY;IACZ,eAAe;IACf,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;CACf,CAAC;AAEF,MAAM,QAAQ,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"stepObservation.js","sourceRoot":"","sources":["../../src/recipes/stepObservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA0BH;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAA6C;IACrE,uDAAuD;IACvD,gEAAgE;IAChE,qEAAqE;IACrE,sEAAsE;IACtE,iEAAiE;IACjE,qEAAqE;IACrE,sBAAsB;IACtB;QACE,KAAK,EACH,mFAAmF;QACrF,MAAM,EAAE,4CAA4C;KACrD;IACD,yEAAyE;IACzE,wEAAwE;IACxE,kEAAkE;IAClE,wEAAwE;IACxE,wDAAwD;IACxD;QACE,KAAK,EAAE,mDAAmD;QAC1D,MAAM,EAAE,qBAAqB;KAC9B;IACD,oEAAoE;IACpE,+DAA+D;IAC/D,qEAAqE;IACrE;QACE,KAAK,EAAE,qCAAqC;QAC5C,MAAM,EAAE,mDAAmD;KAC5D;IACD,6DAA6D;IAC7D;QACE,KAAK,EAAE,+BAA+B;QACtC,MAAM,EAAE,6CAA6C;KACtD;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAe;IAC9C,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEzD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAA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able tools — record access via the Airtable REST API v0.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Read tools
|
|
5
|
+
* (list_records, get_record, list_bases) declare `isWrite: false`; the write
|
|
6
|
+
* tool (create_record) declares `isWrite: true` so the approval queue and
|
|
7
|
+
* kill-switch gate it appropriately.
|
|
8
|
+
*
|
|
9
|
+
* Mirrors the `AirtableConnector` method signatures exactly:
|
|
10
|
+
* - listRecords(baseId, tableIdOrName, params?)
|
|
11
|
+
* - getRecord(baseId, tableIdOrName, recordId)
|
|
12
|
+
* - createRecord(baseId, tableIdOrName, fields)
|
|
13
|
+
* - listBases()
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Airtable tools — record access via the Airtable REST API v0.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Read tools
|
|
5
|
+
* (list_records, get_record, list_bases) declare `isWrite: false`; the write
|
|
6
|
+
* tool (create_record) declares `isWrite: true` so the approval queue and
|
|
7
|
+
* kill-switch gate it appropriately.
|
|
8
|
+
*
|
|
9
|
+
* Mirrors the `AirtableConnector` method signatures exactly:
|
|
10
|
+
* - listRecords(baseId, tableIdOrName, params?)
|
|
11
|
+
* - getRecord(baseId, tableIdOrName, recordId)
|
|
12
|
+
* - createRecord(baseId, tableIdOrName, fields)
|
|
13
|
+
* - listBases()
|
|
14
|
+
*/
|
|
15
|
+
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
16
|
+
import { wrapConnectorExecute } from "./wrapConnectorExecute.js";
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// airtable.list_records
|
|
19
|
+
// ============================================================================
|
|
20
|
+
registerTool({
|
|
21
|
+
id: "airtable.list_records",
|
|
22
|
+
namespace: "airtable",
|
|
23
|
+
description: "List records from an Airtable table, with optional filter formula, view, sort, field selection, and paging.",
|
|
24
|
+
paramsSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
baseId: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Airtable base id (app...)",
|
|
30
|
+
},
|
|
31
|
+
tableIdOrName: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Airtable table id (tbl...) or table name",
|
|
34
|
+
},
|
|
35
|
+
filterByFormula: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Airtable formula to filter records server-side",
|
|
38
|
+
},
|
|
39
|
+
view: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "Restrict results to a named view",
|
|
42
|
+
},
|
|
43
|
+
maxRecords: {
|
|
44
|
+
type: "number",
|
|
45
|
+
description: "Max records to return (default 100, hard cap 1000)",
|
|
46
|
+
},
|
|
47
|
+
pageSize: {
|
|
48
|
+
type: "number",
|
|
49
|
+
description: "Records per page (max 100)",
|
|
50
|
+
},
|
|
51
|
+
fields: {
|
|
52
|
+
type: "array",
|
|
53
|
+
items: { type: "string" },
|
|
54
|
+
description: "Restrict returned fields to this list",
|
|
55
|
+
},
|
|
56
|
+
sort: {
|
|
57
|
+
type: "array",
|
|
58
|
+
items: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
field: { type: "string" },
|
|
62
|
+
direction: { type: "string", enum: ["asc", "desc"] },
|
|
63
|
+
},
|
|
64
|
+
required: ["field"],
|
|
65
|
+
},
|
|
66
|
+
description: "Sort directives, applied in order",
|
|
67
|
+
},
|
|
68
|
+
into: CommonSchemas.into,
|
|
69
|
+
},
|
|
70
|
+
required: ["baseId", "tableIdOrName"],
|
|
71
|
+
},
|
|
72
|
+
outputSchema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: {
|
|
75
|
+
records: {
|
|
76
|
+
type: "array",
|
|
77
|
+
items: {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
id: { type: "string" },
|
|
81
|
+
createdTime: { type: "string" },
|
|
82
|
+
fields: { type: "object" },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
offset: { type: "string" },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
riskDefault: "low",
|
|
90
|
+
isWrite: false,
|
|
91
|
+
isConnector: true,
|
|
92
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
93
|
+
const { getAirtableConnector } = await import("../../connectors/airtable.js");
|
|
94
|
+
const connector = getAirtableConnector();
|
|
95
|
+
const result = await connector.listRecords(params.baseId, params.tableIdOrName, {
|
|
96
|
+
filterByFormula: typeof params.filterByFormula === "string"
|
|
97
|
+
? params.filterByFormula
|
|
98
|
+
: undefined,
|
|
99
|
+
view: typeof params.view === "string" ? params.view : undefined,
|
|
100
|
+
maxRecords: typeof params.maxRecords === "number" ? params.maxRecords : undefined,
|
|
101
|
+
pageSize: typeof params.pageSize === "number" ? params.pageSize : undefined,
|
|
102
|
+
fields: Array.isArray(params.fields)
|
|
103
|
+
? params.fields
|
|
104
|
+
: undefined,
|
|
105
|
+
sort: Array.isArray(params.sort)
|
|
106
|
+
? params.sort
|
|
107
|
+
: undefined,
|
|
108
|
+
});
|
|
109
|
+
return JSON.stringify(result);
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
// ============================================================================
|
|
113
|
+
// airtable.get_record
|
|
114
|
+
// ============================================================================
|
|
115
|
+
registerTool({
|
|
116
|
+
id: "airtable.get_record",
|
|
117
|
+
namespace: "airtable",
|
|
118
|
+
description: "Fetch a single Airtable record by id.",
|
|
119
|
+
paramsSchema: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
baseId: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Airtable base id (app...)",
|
|
125
|
+
},
|
|
126
|
+
tableIdOrName: {
|
|
127
|
+
type: "string",
|
|
128
|
+
description: "Airtable table id (tbl...) or table name",
|
|
129
|
+
},
|
|
130
|
+
recordId: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "Airtable record id (rec...)",
|
|
133
|
+
},
|
|
134
|
+
into: CommonSchemas.into,
|
|
135
|
+
},
|
|
136
|
+
required: ["baseId", "tableIdOrName", "recordId"],
|
|
137
|
+
},
|
|
138
|
+
outputSchema: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
id: { type: "string" },
|
|
142
|
+
createdTime: { type: "string" },
|
|
143
|
+
fields: { type: "object" },
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
riskDefault: "low",
|
|
147
|
+
isWrite: false,
|
|
148
|
+
isConnector: true,
|
|
149
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
150
|
+
const { getAirtableConnector } = await import("../../connectors/airtable.js");
|
|
151
|
+
const connector = getAirtableConnector();
|
|
152
|
+
const result = await connector.getRecord(params.baseId, params.tableIdOrName, params.recordId);
|
|
153
|
+
return JSON.stringify(result);
|
|
154
|
+
}),
|
|
155
|
+
});
|
|
156
|
+
// ============================================================================
|
|
157
|
+
// airtable.create_record (write-gated)
|
|
158
|
+
// ============================================================================
|
|
159
|
+
registerTool({
|
|
160
|
+
id: "airtable.create_record",
|
|
161
|
+
namespace: "airtable",
|
|
162
|
+
description: "Create a single record in an Airtable table.",
|
|
163
|
+
paramsSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
baseId: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Airtable base id (app...)",
|
|
169
|
+
},
|
|
170
|
+
tableIdOrName: {
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "Airtable table id (tbl...) or table name",
|
|
173
|
+
},
|
|
174
|
+
fields: {
|
|
175
|
+
type: "object",
|
|
176
|
+
description: "Field values for the new record, keyed by Airtable field name or id",
|
|
177
|
+
},
|
|
178
|
+
into: CommonSchemas.into,
|
|
179
|
+
},
|
|
180
|
+
required: ["baseId", "tableIdOrName", "fields"],
|
|
181
|
+
},
|
|
182
|
+
outputSchema: {
|
|
183
|
+
type: "object",
|
|
184
|
+
properties: {
|
|
185
|
+
id: { type: "string" },
|
|
186
|
+
createdTime: { type: "string" },
|
|
187
|
+
fields: { type: "object" },
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
riskDefault: "medium",
|
|
191
|
+
isWrite: true,
|
|
192
|
+
isConnector: true,
|
|
193
|
+
execute: wrapConnectorExecute(async ({ params }) => {
|
|
194
|
+
const { getAirtableConnector } = await import("../../connectors/airtable.js");
|
|
195
|
+
const connector = getAirtableConnector();
|
|
196
|
+
const result = await connector.createRecord(params.baseId, params.tableIdOrName, params.fields ?? {});
|
|
197
|
+
return JSON.stringify(result);
|
|
198
|
+
}),
|
|
199
|
+
});
|
|
200
|
+
// ============================================================================
|
|
201
|
+
// airtable.list_bases
|
|
202
|
+
// ============================================================================
|
|
203
|
+
registerTool({
|
|
204
|
+
id: "airtable.list_bases",
|
|
205
|
+
namespace: "airtable",
|
|
206
|
+
description: "List Airtable bases the authenticated token can access.",
|
|
207
|
+
paramsSchema: {
|
|
208
|
+
type: "object",
|
|
209
|
+
properties: {
|
|
210
|
+
into: CommonSchemas.into,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
outputSchema: {
|
|
214
|
+
type: "object",
|
|
215
|
+
properties: {
|
|
216
|
+
bases: {
|
|
217
|
+
type: "array",
|
|
218
|
+
items: {
|
|
219
|
+
type: "object",
|
|
220
|
+
properties: {
|
|
221
|
+
id: { type: "string" },
|
|
222
|
+
name: { type: "string" },
|
|
223
|
+
permissionLevel: { type: "string" },
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
offset: { type: "string" },
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
riskDefault: "low",
|
|
231
|
+
isWrite: false,
|
|
232
|
+
isConnector: true,
|
|
233
|
+
execute: wrapConnectorExecute(async () => {
|
|
234
|
+
const { getAirtableConnector } = await import("../../connectors/airtable.js");
|
|
235
|
+
const connector = getAirtableConnector();
|
|
236
|
+
const result = await connector.listBases();
|
|
237
|
+
return JSON.stringify(result);
|
|
238
|
+
}),
|
|
239
|
+
});
|
|
240
|
+
//# sourceMappingURL=airtable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"airtable.js","sourceRoot":"","sources":["../../../src/recipes/tools/airtable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,YAAY,CAAC;IACX,EAAE,EAAE,uBAAuB;IAC3B,SAAS,EAAE,UAAU;IACrB,WAAW,EACT,6GAA6G;IAC/G,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2BAA2B;aACzC;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0CAA0C;aACxD;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kCAAkC;aAChD;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oDAAoD;aAClE;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;aAC1C;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,uCAAuC;aACrD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,KAAK,EAAE,EA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,EAAE,IAAI,EAAE,QAAQ,EAAE;qBACpC;iBACF;aACF;YACD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3B;KACF;IACD,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,oBAAoB,CAAC,KAAK,IAAI,EAAE;QACvC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAC3C,8BAA8B,CAC/B,CAAC;QACF,MAAM,SAAS,GAAG,oBAAoB,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cal.diy tools — scheduling via the Cal.com-compatible API.
|
|
3
|
+
*
|
|
4
|
+
* Self-registering tool module for the recipe tool registry. Read tools wrap
|
|
5
|
+
* event types and bookings; the single write tool cancels a booking.
|
|
6
|
+
*
|
|
7
|
+
* Wraps the Cal.diy connector (src/connectors/caldiy.ts):
|
|
8
|
+
* - getEventTypes() → list_event_types (read)
|
|
9
|
+
* - getBookings({status, attendeeEmail,…}) → list_bookings (read)
|
|
10
|
+
* - getBooking(uid) → get_booking (read)
|
|
11
|
+
* - cancelBooking(uid, reason?) → cancel_booking (write)
|
|
12
|
+
*/
|
|
13
|
+
export {};
|