patchwork-os 0.2.0-alpha.35 → 0.2.0-alpha.37
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 +70 -15
- package/dist/activityLog.d.ts +49 -0
- package/dist/activityLog.js +78 -0
- package/dist/activityLog.js.map +1 -1
- package/dist/approvalHttp.d.ts +25 -0
- package/dist/approvalHttp.js +74 -18
- package/dist/approvalHttp.js.map +1 -1
- package/dist/approvalInsights.d.ts +49 -0
- package/dist/approvalInsights.js +97 -0
- package/dist/approvalInsights.js.map +1 -0
- package/dist/approvalQueue.d.ts +11 -0
- package/dist/approvalQueue.js +80 -1
- package/dist/approvalQueue.js.map +1 -1
- package/dist/approvalSignals.d.ts +124 -0
- package/dist/approvalSignals.js +512 -0
- package/dist/approvalSignals.js.map +1 -0
- package/dist/automation.d.ts +37 -0
- package/dist/automation.js +105 -61
- package/dist/automation.js.map +1 -1
- package/dist/automationSuggestions.d.ts +79 -0
- package/dist/automationSuggestions.js +150 -0
- package/dist/automationSuggestions.js.map +1 -0
- package/dist/bridge.js +46 -0
- package/dist/bridge.js.map +1 -1
- package/dist/ccPermissions.d.ts +15 -0
- package/dist/ccPermissions.js +15 -0
- package/dist/ccPermissions.js.map +1 -1
- package/dist/claudeDriver.js +74 -16
- package/dist/claudeDriver.js.map +1 -1
- package/dist/commands/patchworkInit.d.ts +8 -0
- package/dist/commands/patchworkInit.js +41 -5
- package/dist/commands/patchworkInit.js.map +1 -1
- package/dist/commands/recipe.d.ts +20 -0
- package/dist/commands/recipe.js +194 -5
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/recipeInstall.js +93 -4
- package/dist/commands/recipeInstall.js.map +1 -1
- package/dist/commands/tracesExport.d.ts +83 -0
- package/dist/commands/tracesExport.js +269 -0
- package/dist/commands/tracesExport.js.map +1 -0
- package/dist/commands/tracesImport.d.ts +56 -0
- package/dist/commands/tracesImport.js +161 -0
- package/dist/commands/tracesImport.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.js +9 -1
- package/dist/config.js.map +1 -1
- package/dist/connectorRoutes.d.ts +43 -0
- package/dist/connectorRoutes.js +1713 -0
- package/dist/connectorRoutes.js.map +1 -0
- package/dist/connectors/asana.js +6 -7
- package/dist/connectors/asana.js.map +1 -1
- package/dist/connectors/baseConnector.d.ts +20 -0
- package/dist/connectors/baseConnector.js +45 -4
- package/dist/connectors/baseConnector.js.map +1 -1
- package/dist/connectors/discord.js +6 -7
- package/dist/connectors/discord.js.map +1 -1
- package/dist/connectors/gmail.js +39 -10
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.js +36 -10
- package/dist/connectors/googleCalendar.js.map +1 -1
- package/dist/connectors/googleDrive.js +22 -6
- package/dist/connectors/googleDrive.js.map +1 -1
- package/dist/connectors/linear.js +2 -2
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpOAuth.js +26 -2
- package/dist/connectors/mcpOAuth.js.map +1 -1
- package/dist/connectors/oauthStateStore.d.ts +31 -0
- package/dist/connectors/oauthStateStore.js +52 -0
- package/dist/connectors/oauthStateStore.js.map +1 -0
- package/dist/connectors/slack.d.ts +15 -0
- package/dist/connectors/slack.js +54 -4
- package/dist/connectors/slack.js.map +1 -1
- package/dist/connectors/tokenStorage.js +27 -2
- package/dist/connectors/tokenStorage.js.map +1 -1
- package/dist/connectors/zendesk.js +19 -1
- package/dist/connectors/zendesk.js.map +1 -1
- package/dist/cors.d.ts +10 -0
- package/dist/cors.js +29 -0
- package/dist/cors.js.map +1 -0
- package/dist/decisionReplay.d.ts +72 -0
- package/dist/decisionReplay.js +92 -0
- package/dist/decisionReplay.js.map +1 -0
- package/dist/decisionTraceLog.d.ts +6 -0
- package/dist/decisionTraceLog.js +54 -2
- package/dist/decisionTraceLog.js.map +1 -1
- package/dist/fp/automationInterpreter.js +25 -21
- package/dist/fp/automationInterpreter.js.map +1 -1
- package/dist/fp/automationState.js +4 -1
- package/dist/fp/automationState.js.map +1 -1
- package/dist/fp/policyParser.js +4 -1
- package/dist/fp/policyParser.js.map +1 -1
- package/dist/inboxRoutes.d.ts +22 -0
- package/dist/inboxRoutes.js +114 -0
- package/dist/inboxRoutes.js.map +1 -0
- package/dist/index.js +479 -17
- package/dist/index.js.map +1 -1
- package/dist/mcpRoutes.d.ts +37 -0
- package/dist/mcpRoutes.js +76 -0
- package/dist/mcpRoutes.js.map +1 -0
- package/dist/oauth.d.ts +3 -0
- package/dist/oauth.js +151 -26
- package/dist/oauth.js.map +1 -1
- package/dist/oauthRoutes.d.ts +32 -0
- package/dist/oauthRoutes.js +124 -0
- package/dist/oauthRoutes.js.map +1 -0
- package/dist/orchestrator/orchestratorBridge.js +2 -2
- package/dist/orchestrator/orchestratorBridge.js.map +1 -1
- package/dist/patchworkConfig.d.ts +7 -0
- package/dist/patchworkConfig.js.map +1 -1
- package/dist/pluginLoader.d.ts +12 -0
- package/dist/pluginLoader.js +43 -4
- package/dist/pluginLoader.js.map +1 -1
- package/dist/pluginWatcher.js +8 -3
- package/dist/pluginWatcher.js.map +1 -1
- package/dist/preToolUseHook.d.ts +12 -0
- package/dist/preToolUseHook.js +23 -0
- package/dist/preToolUseHook.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +1 -0
- package/dist/recipeOrchestration.js +173 -13
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/recipeRoutes.d.ts +154 -0
- package/dist/recipeRoutes.js +1107 -0
- package/dist/recipeRoutes.js.map +1 -0
- package/dist/recipes/chainedRunner.d.ts +15 -0
- package/dist/recipes/chainedRunner.js +73 -8
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/compiler.js +3 -3
- package/dist/recipes/compiler.js.map +1 -1
- package/dist/recipes/installer.js +3 -3
- package/dist/recipes/installer.js.map +1 -1
- package/dist/recipes/migrationWarnings.d.ts +12 -0
- package/dist/recipes/migrationWarnings.js +44 -0
- package/dist/recipes/migrationWarnings.js.map +1 -0
- package/dist/recipes/resolveRecipePath.d.ts +69 -0
- package/dist/recipes/resolveRecipePath.js +202 -0
- package/dist/recipes/resolveRecipePath.js.map +1 -0
- package/dist/recipes/tools/file.d.ts +6 -0
- package/dist/recipes/tools/file.js +12 -8
- package/dist/recipes/tools/file.js.map +1 -1
- package/dist/recipes/tools/index.d.ts +2 -0
- package/dist/recipes/tools/index.js +2 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/jira.d.ts +14 -0
- package/dist/recipes/tools/jira.js +369 -0
- package/dist/recipes/tools/jira.js.map +1 -0
- package/dist/recipes/tools/linear.js +6 -3
- package/dist/recipes/tools/linear.js.map +1 -1
- package/dist/recipes/tools/sentry.d.ts +12 -0
- package/dist/recipes/tools/sentry.js +73 -0
- package/dist/recipes/tools/sentry.js.map +1 -0
- package/dist/recipes/tools/slack.js +7 -3
- package/dist/recipes/tools/slack.js.map +1 -1
- package/dist/recipes/validation.js +83 -14
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/yamlRunner.d.ts +7 -0
- package/dist/recipes/yamlRunner.js +107 -13
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +44 -1
- package/dist/recipesHttp.js +168 -15
- package/dist/recipesHttp.js.map +1 -1
- package/dist/runLog.d.ts +14 -0
- package/dist/runLog.js +88 -4
- package/dist/runLog.js.map +1 -1
- package/dist/schemas/dry-run-plan.v1.json +139 -0
- package/dist/schemas/recipe.v1.json +684 -0
- package/dist/server.d.ts +71 -10
- package/dist/server.js +363 -1703
- package/dist/server.js.map +1 -1
- package/dist/ssrfGuard.d.ts +54 -0
- package/dist/ssrfGuard.js +122 -0
- package/dist/ssrfGuard.js.map +1 -0
- package/dist/streamableHttp.d.ts +8 -0
- package/dist/streamableHttp.js +112 -21
- package/dist/streamableHttp.js.map +1 -1
- package/dist/tools/getDocumentSymbols.d.ts +24 -0
- package/dist/tools/getDocumentSymbols.js +74 -8
- package/dist/tools/getDocumentSymbols.js.map +1 -1
- package/dist/tools/getSecurityAdvisories.js +10 -1
- package/dist/tools/getSecurityAdvisories.js.map +1 -1
- package/dist/tools/getSessionUsage.d.ts +3 -0
- package/dist/tools/getSessionUsage.js +3 -0
- package/dist/tools/getSessionUsage.js.map +1 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +32 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/transaction.d.ts +19 -0
- package/dist/tools/transaction.js +29 -0
- package/dist/tools/transaction.js.map +1 -1
- package/dist/traceEncryption.d.ts +46 -0
- package/dist/traceEncryption.js +124 -0
- package/dist/traceEncryption.js.map +1 -0
- package/dist/transport.d.ts +39 -0
- package/dist/transport.js +88 -8
- package/dist/transport.js.map +1 -1
- package/package.json +4 -2
- package/templates/policies/README.md +72 -0
- package/templates/policies/conservative.json +14 -0
- package/templates/policies/developer.json +14 -0
- package/templates/policies/headless-ci.json +24 -0
- package/templates/policies/personal-assistant.json +15 -0
- package/templates/policies/regulated-industry.json +18 -0
- package/templates/recipes/webhook/README.md +70 -0
- package/templates/recipes/webhook/capture-thought.yaml +26 -0
- package/templates/recipes/webhook/customer-escalation.yaml +49 -0
- package/templates/recipes/webhook/incident-intake.yaml +46 -0
- package/templates/recipes/webhook/meeting-prep.yaml +48 -0
- package/templates/recipes/webhook/morning-brief.yaml +57 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* resolveRecipePath — recipe-runner path jail.
|
|
3
|
+
*
|
|
4
|
+
* Closes G-security F-01 (CRITICAL — `file.read/write/append` accept any
|
|
5
|
+
* absolute path), F-02 (CRITICAL — template-substituted vars escape via
|
|
6
|
+
* `..`), and the R2 C-1 chained-runner third-substitution-site gap.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors the symlink-walking strategy from `src/tools/utils.ts:104-200`
|
|
9
|
+
* (`resolveFilePath`) but operates against an allowlist of recipe-roots
|
|
10
|
+
* rather than a single workspace root:
|
|
11
|
+
*
|
|
12
|
+
* - `~/.patchwork/` (always allowed — recipe install dir)
|
|
13
|
+
* - the bridge / CLI workspace (always allowed — passed in via `opts.workspace`)
|
|
14
|
+
* - `os.tmpdir()` (OFF by default; opt-in via the
|
|
15
|
+
* `CLAUDE_IDE_BRIDGE_RECIPE_TMP_JAIL=1`
|
|
16
|
+
* env var, per R2 C-2 maintainer decision)
|
|
17
|
+
*
|
|
18
|
+
* On any escape (null byte, segment outside all roots, symlink target
|
|
19
|
+
* outside roots, hardlink on a write target) the helper throws an `Error`
|
|
20
|
+
* with `err.code = "recipe_path_jail_escape"`. Callers and tests must
|
|
21
|
+
* assert on `err.code`, never on message text (R2 M-4).
|
|
22
|
+
*
|
|
23
|
+
* Defense-in-depth — apply at every layer:
|
|
24
|
+
* - `src/recipes/tools/file.ts` (per-tool execute())
|
|
25
|
+
* - `src/recipes/yamlRunner.ts:976-994` (default StepDeps file ops)
|
|
26
|
+
* - `src/recipes/yamlRunner.ts:642` (post-render path snapshot)
|
|
27
|
+
* - `src/recipes/yamlRunner.ts:1252-1262` (chained-runner executeTool)
|
|
28
|
+
* - `src/recipes/chainedRunner.ts:194-205` (template-substitution site)
|
|
29
|
+
* - `src/recipeRoutes.ts:131-138 :172-181` (HTTP vars validator)
|
|
30
|
+
* - `src/commands/recipe.ts:1080-1102` (CLI warn on out-of-jail recipe ref)
|
|
31
|
+
*/
|
|
32
|
+
import fs from "node:fs";
|
|
33
|
+
import os from "node:os";
|
|
34
|
+
import path from "node:path";
|
|
35
|
+
/** Build a jail error with the canonical code. Never expose internals via message-matching. */
|
|
36
|
+
function jailError(message) {
|
|
37
|
+
const err = new Error(message);
|
|
38
|
+
err.code = "recipe_path_jail_escape";
|
|
39
|
+
return err;
|
|
40
|
+
}
|
|
41
|
+
/** Expand a leading `~/` segment using `os.homedir()` (or the test override). */
|
|
42
|
+
function expandHome(p, homeDir) {
|
|
43
|
+
if (p === "~")
|
|
44
|
+
return homeDir;
|
|
45
|
+
if (p.startsWith("~/"))
|
|
46
|
+
return path.join(homeDir, p.slice(2));
|
|
47
|
+
return p;
|
|
48
|
+
}
|
|
49
|
+
/** Compute the active jail roots given the runtime opts. */
|
|
50
|
+
function jailRoots(opts) {
|
|
51
|
+
const homeDir = opts.homeDir ?? os.homedir();
|
|
52
|
+
const allowTmp = opts.allowTmp ?? process.env.CLAUDE_IDE_BRIDGE_RECIPE_TMP_JAIL === "1";
|
|
53
|
+
const workspace = opts.workspace ?? process.cwd();
|
|
54
|
+
const roots = [path.resolve(homeDir, ".patchwork"), path.resolve(workspace)];
|
|
55
|
+
if (allowTmp) {
|
|
56
|
+
// On macOS `os.tmpdir()` returns `/var/folders/...` but the conventional
|
|
57
|
+
// `/tmp` symlink points at `/private/tmp` — we expose both so a recipe
|
|
58
|
+
// (or a legacy test) that hard-codes `/tmp/...` resolves cleanly. The
|
|
59
|
+
// symlink-aware realpath check below will still reject anything whose
|
|
60
|
+
// physical target is outside both roots.
|
|
61
|
+
roots.push(path.resolve(os.tmpdir()));
|
|
62
|
+
roots.push("/tmp");
|
|
63
|
+
}
|
|
64
|
+
// Dedupe — workspace==tmpdir on some CI runners would double-count and
|
|
65
|
+
// confuse the "outside all roots" reject branch.
|
|
66
|
+
return Array.from(new Set(roots));
|
|
67
|
+
}
|
|
68
|
+
/** True if `target` is inside (or equal to) any allowed jail root. */
|
|
69
|
+
function isInsideAnyRoot(target, roots) {
|
|
70
|
+
for (const root of roots) {
|
|
71
|
+
if (target === root)
|
|
72
|
+
return true;
|
|
73
|
+
if (target.startsWith(root + path.sep))
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Walk up the ancestor chain of a (possibly non-existent) path, returning
|
|
80
|
+
* the realpath of the first ancestor that exists on disk plus the unresolved
|
|
81
|
+
* suffix. Mirrors `src/tools/utils.ts:130-177` so a symlink anywhere along
|
|
82
|
+
* the chain (including the bridge / install dir) is followed before the
|
|
83
|
+
* containment check.
|
|
84
|
+
*/
|
|
85
|
+
function realpathOrAncestor(p) {
|
|
86
|
+
try {
|
|
87
|
+
return fs.realpathSync(p);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
let ancestor = path.dirname(p);
|
|
91
|
+
const suffix = [path.basename(p)];
|
|
92
|
+
while (ancestor !== path.dirname(ancestor)) {
|
|
93
|
+
try {
|
|
94
|
+
const realAncestor = fs.realpathSync(ancestor);
|
|
95
|
+
return path.join(realAncestor, ...suffix);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
suffix.unshift(path.basename(ancestor));
|
|
99
|
+
ancestor = path.dirname(ancestor);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Reached fs root without finding a real ancestor — fail closed; the
|
|
103
|
+
// caller will translate this to a jail-escape rather than skip the
|
|
104
|
+
// containment check.
|
|
105
|
+
throw new Error(`no real ancestor found for "${p}"`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Resolve a recipe-supplied path, expanding `~/`, normalising, and asserting
|
|
110
|
+
* the result lives inside one of the jail roots after symlink resolution.
|
|
111
|
+
*
|
|
112
|
+
* Throws `RecipePathJailError` (code `"recipe_path_jail_escape"`) on any
|
|
113
|
+
* containment violation. Callers should propagate the error unchanged so
|
|
114
|
+
* tests can assert on `err.code`.
|
|
115
|
+
*/
|
|
116
|
+
export function resolveRecipePath(rawPath, opts = {}) {
|
|
117
|
+
if (typeof rawPath !== "string") {
|
|
118
|
+
throw jailError("recipe path must be a string");
|
|
119
|
+
}
|
|
120
|
+
if (rawPath.length === 0) {
|
|
121
|
+
throw jailError("recipe path must not be empty");
|
|
122
|
+
}
|
|
123
|
+
if (rawPath.includes("\x00")) {
|
|
124
|
+
throw jailError("recipe path must not contain null bytes");
|
|
125
|
+
}
|
|
126
|
+
const homeDir = opts.homeDir ?? os.homedir();
|
|
127
|
+
const expanded = expandHome(rawPath, homeDir);
|
|
128
|
+
const resolved = path.isAbsolute(expanded)
|
|
129
|
+
? path.resolve(expanded)
|
|
130
|
+
: path.resolve(opts.workspace ?? process.cwd(), expanded);
|
|
131
|
+
const roots = jailRoots(opts);
|
|
132
|
+
// Lexical containment first — cheap reject for `..` segments resolving
|
|
133
|
+
// outside any root before we do any FS calls.
|
|
134
|
+
if (!isInsideAnyRoot(resolved, roots)) {
|
|
135
|
+
throw jailError(`recipe path "${rawPath}" resolves outside the allowed jail roots`);
|
|
136
|
+
}
|
|
137
|
+
// Symlink-aware re-check. We resolve the realpath of every existing
|
|
138
|
+
// ancestor so a link at any level (including a freshly-installed recipe
|
|
139
|
+
// dir pointing at `/tmp`) cannot bypass the lexical check above.
|
|
140
|
+
let real;
|
|
141
|
+
try {
|
|
142
|
+
real = realpathOrAncestor(resolved);
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
throw jailError(`recipe path "${rawPath}" failed symlink resolution: ${err instanceof Error ? err.message : String(err)}`);
|
|
146
|
+
}
|
|
147
|
+
const realRoots = [];
|
|
148
|
+
for (const root of roots) {
|
|
149
|
+
try {
|
|
150
|
+
realRoots.push(fs.realpathSync(root));
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Root does not exist yet (e.g. ~/.patchwork on a fresh install).
|
|
154
|
+
// Use the resolved (lexical) form — `mkdirSync({recursive:true})`
|
|
155
|
+
// will create it inside the lexical jail anyway, and the symlink
|
|
156
|
+
// walk above already confirmed nothing on disk redirects out.
|
|
157
|
+
realRoots.push(root);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (!isInsideAnyRoot(real, realRoots)) {
|
|
161
|
+
throw jailError(`recipe path "${rawPath}" escapes jail via symlink (real target "${real}")`);
|
|
162
|
+
}
|
|
163
|
+
// Hardlink guard for write paths — same rationale as `resolveFilePath`'s
|
|
164
|
+
// `opts.write` branch: a hardlink from inside the jail to an outside
|
|
165
|
+
// file shares an inode and passes the realpath check, but writing
|
|
166
|
+
// through it would modify the outside file.
|
|
167
|
+
if (opts.write) {
|
|
168
|
+
try {
|
|
169
|
+
const lst = fs.lstatSync(resolved);
|
|
170
|
+
if (!lst.isDirectory() && lst.nlink > 1) {
|
|
171
|
+
throw jailError(`recipe path "${rawPath}" is a hardlink (nlink=${lst.nlink}); writes denied to prevent jail escape`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
// ENOENT — file doesn't exist yet, safe to create. Re-throw if it's
|
|
176
|
+
// already a jail error (the nlink branch above).
|
|
177
|
+
if (err instanceof Error &&
|
|
178
|
+
err.code === "recipe_path_jail_escape") {
|
|
179
|
+
throw err;
|
|
180
|
+
}
|
|
181
|
+
// Other lstat errors (EACCES, etc.) — non-fatal; the write call will
|
|
182
|
+
// surface them with the OS-level message.
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return resolved;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Side-effect-free predicate variant — returns `null` on jail escape rather
|
|
189
|
+
* than throwing. Used by the CLI `recipe run` warn path (F-10), which wants
|
|
190
|
+
* to write a stderr notice when a recipe **file** lives outside the jail
|
|
191
|
+
* but still loads it (the YAML loader is a separate trust boundary from the
|
|
192
|
+
* tool dispatch jail).
|
|
193
|
+
*/
|
|
194
|
+
export function tryResolveRecipePath(rawPath, opts = {}) {
|
|
195
|
+
try {
|
|
196
|
+
return resolveRecipePath(rawPath, opts);
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=resolveRecipePath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRecipePath.js","sourceRoot":"","sources":["../../src/recipes/resolveRecipePath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,I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IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAe,EACf,OAAiC,EAAE;IAEnC,IAAI,CAAC;QACH,OAAO,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -2,5 +2,11 @@
|
|
|
2
2
|
* File tools — file.read, file.write, file.append
|
|
3
3
|
*
|
|
4
4
|
* Self-registering tool module for the recipe tool registry.
|
|
5
|
+
*
|
|
6
|
+
* Path containment is enforced via `resolveRecipePath` (see
|
|
7
|
+
* `../resolveRecipePath.ts`) — every path passed in by a recipe is
|
|
8
|
+
* normalized, symlink-resolved, and asserted inside the recipe jail
|
|
9
|
+
* roots before any FS call. Closes G-security F-01 / F-02 / F-10 + R2
|
|
10
|
+
* C-1.
|
|
5
11
|
*/
|
|
6
12
|
export {};
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
* File tools — file.read, file.write, file.append
|
|
3
3
|
*
|
|
4
4
|
* Self-registering tool module for the recipe tool registry.
|
|
5
|
+
*
|
|
6
|
+
* Path containment is enforced via `resolveRecipePath` (see
|
|
7
|
+
* `../resolveRecipePath.ts`) — every path passed in by a recipe is
|
|
8
|
+
* normalized, symlink-resolved, and asserted inside the recipe jail
|
|
9
|
+
* roots before any FS call. Closes G-security F-01 / F-02 / F-10 + R2
|
|
10
|
+
* C-1.
|
|
5
11
|
*/
|
|
6
12
|
import { existsSync, mkdirSync } from "node:fs";
|
|
7
13
|
import { dirname } from "node:path";
|
|
8
14
|
import { assertWriteAllowed } from "../../featureFlags.js";
|
|
15
|
+
import { resolveRecipePath } from "../resolveRecipePath.js";
|
|
9
16
|
import { CommonSchemas, registerTool } from "../toolRegistry.js";
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
return `${process.env.HOME ?? process.env.USERPROFILE}${p.slice(1)}`;
|
|
13
|
-
}
|
|
14
|
-
return p;
|
|
17
|
+
function jailedPath(p, workspace, write) {
|
|
18
|
+
return resolveRecipePath(p, { workspace, write });
|
|
15
19
|
}
|
|
16
20
|
function ensureDir(p) {
|
|
17
21
|
const dir = dirname(p);
|
|
@@ -42,7 +46,7 @@ registerTool({
|
|
|
42
46
|
riskDefault: "low",
|
|
43
47
|
isWrite: false,
|
|
44
48
|
execute: async ({ params, step, deps }) => {
|
|
45
|
-
const p =
|
|
49
|
+
const p = jailedPath(params.path, deps.workdir, false);
|
|
46
50
|
const optional = step.optional ?? false;
|
|
47
51
|
try {
|
|
48
52
|
return deps.readFile(p);
|
|
@@ -84,7 +88,7 @@ registerTool({
|
|
|
84
88
|
isWrite: true,
|
|
85
89
|
execute: async ({ params, deps }) => {
|
|
86
90
|
assertWriteAllowed("file.write");
|
|
87
|
-
const p =
|
|
91
|
+
const p = jailedPath(params.path, deps.workdir, true);
|
|
88
92
|
const content = params.content;
|
|
89
93
|
ensureDir(p);
|
|
90
94
|
deps.writeFile(p, content);
|
|
@@ -122,7 +126,7 @@ registerTool({
|
|
|
122
126
|
isWrite: true,
|
|
123
127
|
execute: async ({ params, step, deps }) => {
|
|
124
128
|
assertWriteAllowed("file.append");
|
|
125
|
-
const p =
|
|
129
|
+
const p = jailedPath(params.path, deps.workdir, true);
|
|
126
130
|
const content = params.content;
|
|
127
131
|
// 'when' condition is evaluated before executeStep is called in yamlRunner
|
|
128
132
|
// but we check here too for direct registry usage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/recipes/tools/file.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/recipes/tools/file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,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CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -21,7 +21,9 @@ import "./intercom.js";
|
|
|
21
21
|
import "./hubspot.js";
|
|
22
22
|
import "./datadog.js";
|
|
23
23
|
import "./discord.js";
|
|
24
|
+
import "./jira.js";
|
|
24
25
|
import "./pagerduty.js";
|
|
26
|
+
import "./sentry.js";
|
|
25
27
|
import "./stripe.js";
|
|
26
28
|
import "./meetingNotes.js";
|
|
27
29
|
export type { RegisteredTool, ToolContext, ToolExecute, ToolMetadata, } from "../toolRegistry.js";
|
|
@@ -23,7 +23,9 @@ import "./intercom.js";
|
|
|
23
23
|
import "./hubspot.js";
|
|
24
24
|
import "./datadog.js";
|
|
25
25
|
import "./discord.js";
|
|
26
|
+
import "./jira.js";
|
|
26
27
|
import "./pagerduty.js";
|
|
28
|
+
import "./sentry.js";
|
|
27
29
|
import "./stripe.js";
|
|
28
30
|
import "./meetingNotes.js";
|
|
29
31
|
// Re-export registry for convenience
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/recipes/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,aAAa;AACb,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,kBAAkB,CAAC;AAE1B,wBAAwB;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,aAAa,CAAC;AACrB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,mBAAmB,CAAC;AAQ3B,qCAAqC;AACrC,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,OAAO,EACP,OAAO,EACP,SAAS,EACT,YAAY,GACb,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/recipes/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,aAAa;AACb,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,kBAAkB,CAAC;AAE1B,wBAAwB;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,aAAa,CAAC;AACrB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,cAAc,CAAC;AACtB,OAAO,WAAW,CAAC;AACnB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,mBAAmB,CAAC;AAQ3B,qCAAqC;AACrC,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,OAAO,EACP,OAAO,EACP,SAAS,EACT,YAAY,GACb,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jira tools — read wrappers (search/fetch/list_projects) plus writes
|
|
3
|
+
* (create_issue, update_status, add_comment).
|
|
4
|
+
*
|
|
5
|
+
* Self-registering tool module for the recipe tool registry. Read tools wrap
|
|
6
|
+
* connector throws into the `{count, items, error}` shape so the runner's
|
|
7
|
+
* silent-fail detector catches connector failures as a step error rather than
|
|
8
|
+
* a silent empty list. Write tools use a single-object response shape and
|
|
9
|
+
* surface failures via an `error` field.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors the asana.ts / linear.ts pattern so recipe authors get a uniform
|
|
12
|
+
* surface across issue trackers.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|