patchwork-os 0.2.0-alpha.33 → 0.2.0-alpha.35
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 +248 -48
- package/deploy/bootstrap-new-vps.sh +12 -12
- package/deploy/bootstrap-vps.sh +6 -3
- package/deploy/deploy-landing.sh +59 -2
- package/dist/bridge.js +35 -1
- package/dist/bridge.js.map +1 -1
- package/dist/commands/recipe.d.ts +11 -0
- package/dist/commands/recipe.js +32 -3
- package/dist/commands/recipe.js.map +1 -1
- package/dist/commands/recipeInstall.d.ts +79 -1
- package/dist/commands/recipeInstall.js +241 -13
- package/dist/commands/recipeInstall.js.map +1 -1
- package/dist/connectors/asana.d.ts +198 -0
- package/dist/connectors/asana.js +680 -0
- package/dist/connectors/asana.js.map +1 -0
- package/dist/connectors/baseConnector.d.ts +16 -0
- package/dist/connectors/baseConnector.js +107 -25
- package/dist/connectors/baseConnector.js.map +1 -1
- package/dist/connectors/discord.d.ts +150 -0
- package/dist/connectors/discord.js +544 -0
- package/dist/connectors/discord.js.map +1 -0
- package/dist/connectors/github.js +15 -7
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gitlab.d.ts +180 -0
- package/dist/connectors/gitlab.js +582 -0
- package/dist/connectors/gitlab.js.map +1 -0
- package/dist/connectors/gmail.js +45 -0
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleDrive.d.ts +34 -0
- package/dist/connectors/googleDrive.js +305 -0
- package/dist/connectors/googleDrive.js.map +1 -0
- package/dist/connectors/htmlEscape.d.ts +5 -0
- package/dist/connectors/htmlEscape.js +13 -0
- package/dist/connectors/htmlEscape.js.map +1 -0
- package/dist/connectors/linear.js +26 -6
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpOAuth.d.ts +2 -0
- package/dist/connectors/mcpOAuth.js +8 -4
- package/dist/connectors/mcpOAuth.js.map +1 -1
- package/dist/connectors/pagerduty.d.ts +160 -0
- package/dist/connectors/pagerduty.js +464 -0
- package/dist/connectors/pagerduty.js.map +1 -0
- package/dist/connectors/sentry.js +3 -2
- package/dist/connectors/sentry.js.map +1 -1
- package/dist/connectors/slack.d.ts +1 -1
- package/dist/connectors/slack.js +7 -4
- package/dist/connectors/slack.js.map +1 -1
- package/dist/featureFlags.d.ts +17 -11
- package/dist/featureFlags.js +52 -47
- package/dist/featureFlags.js.map +1 -1
- package/dist/index.js +262 -129
- package/dist/index.js.map +1 -1
- package/dist/oauth.js +3 -2
- package/dist/oauth.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +7 -0
- package/dist/recipeOrchestration.js +154 -28
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/recipes/agentExecutor.d.ts +1 -0
- package/dist/recipes/agentExecutor.js +7 -0
- package/dist/recipes/agentExecutor.js.map +1 -1
- package/dist/recipes/captureForRunlog.d.ts +27 -0
- package/dist/recipes/captureForRunlog.js +128 -0
- package/dist/recipes/captureForRunlog.js.map +1 -0
- package/dist/recipes/chainedRunner.d.ts +39 -3
- package/dist/recipes/chainedRunner.js +183 -28
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/detectSilentFail.d.ts +34 -0
- package/dist/recipes/detectSilentFail.js +105 -0
- package/dist/recipes/detectSilentFail.js.map +1 -0
- package/dist/recipes/legacyRecipeCompat.d.ts +8 -0
- package/dist/recipes/legacyRecipeCompat.js +20 -1
- package/dist/recipes/legacyRecipeCompat.js.map +1 -1
- package/dist/recipes/manifest.js +21 -6
- package/dist/recipes/manifest.js.map +1 -1
- package/dist/recipes/migrations/index.d.ts +24 -0
- package/dist/recipes/migrations/index.js +55 -0
- package/dist/recipes/migrations/index.js.map +1 -0
- package/dist/recipes/migrations/types.d.ts +28 -0
- package/dist/recipes/migrations/types.js +2 -0
- package/dist/recipes/migrations/types.js.map +1 -0
- package/dist/recipes/migrations/v1.d.ts +11 -0
- package/dist/recipes/migrations/v1.js +18 -0
- package/dist/recipes/migrations/v1.js.map +1 -0
- package/dist/recipes/replayRun.d.ts +62 -0
- package/dist/recipes/replayRun.js +97 -0
- package/dist/recipes/replayRun.js.map +1 -0
- package/dist/recipes/scheduler.js +102 -11
- package/dist/recipes/scheduler.js.map +1 -1
- package/dist/recipes/schemaGenerator.js +3 -3
- package/dist/recipes/schemaGenerator.js.map +1 -1
- package/dist/recipes/templateEngine.js +8 -1
- package/dist/recipes/templateEngine.js.map +1 -1
- package/dist/recipes/toolRegistry.d.ts +5 -0
- package/dist/recipes/toolRegistry.js +9 -0
- package/dist/recipes/toolRegistry.js.map +1 -1
- package/dist/recipes/tools/asana.d.ts +16 -0
- package/dist/recipes/tools/asana.js +524 -0
- package/dist/recipes/tools/asana.js.map +1 -0
- package/dist/recipes/tools/discord.d.ts +18 -0
- package/dist/recipes/tools/discord.js +254 -0
- package/dist/recipes/tools/discord.js.map +1 -0
- package/dist/recipes/tools/github.js +29 -4
- package/dist/recipes/tools/github.js.map +1 -1
- package/dist/recipes/tools/gitlab.d.ts +11 -0
- package/dist/recipes/tools/gitlab.js +285 -0
- package/dist/recipes/tools/gitlab.js.map +1 -0
- package/dist/recipes/tools/gmail.d.ts +1 -1
- package/dist/recipes/tools/gmail.js +230 -6
- package/dist/recipes/tools/gmail.js.map +1 -1
- package/dist/recipes/tools/googleDrive.d.ts +1 -0
- package/dist/recipes/tools/googleDrive.js +55 -0
- package/dist/recipes/tools/googleDrive.js.map +1 -0
- package/dist/recipes/tools/index.d.ts +6 -0
- package/dist/recipes/tools/index.js +6 -0
- package/dist/recipes/tools/index.js.map +1 -1
- package/dist/recipes/tools/linear.d.ts +2 -1
- package/dist/recipes/tools/linear.js +222 -1
- package/dist/recipes/tools/linear.js.map +1 -1
- package/dist/recipes/tools/meetingNotes.d.ts +21 -0
- package/dist/recipes/tools/meetingNotes.js +701 -0
- package/dist/recipes/tools/meetingNotes.js.map +1 -0
- package/dist/recipes/tools/pagerduty.d.ts +15 -0
- package/dist/recipes/tools/pagerduty.js +451 -0
- package/dist/recipes/tools/pagerduty.js.map +1 -0
- package/dist/recipes/tools/slack.js +8 -2
- package/dist/recipes/tools/slack.js.map +1 -1
- package/dist/recipes/validation.js +54 -15
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/yamlRunner.d.ts +23 -2
- package/dist/recipes/yamlRunner.js +265 -60
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/recipesHttp.d.ts +60 -0
- package/dist/recipesHttp.js +418 -3
- package/dist/recipesHttp.js.map +1 -1
- package/dist/runLog.d.ts +64 -2
- package/dist/runLog.js +116 -2
- package/dist/runLog.js.map +1 -1
- package/dist/server.d.ts +21 -0
- package/dist/server.js +387 -8
- package/dist/server.js.map +1 -1
- package/dist/streamableHttp.d.ts +31 -1
- package/dist/streamableHttp.js +20 -2
- package/dist/streamableHttp.js.map +1 -1
- package/dist/tools/activityLog.d.ts +2 -0
- package/dist/tools/addLinearComment.d.ts +1 -0
- package/dist/tools/batchLsp.d.ts +3 -0
- package/dist/tools/bridgeDoctor.d.ts +1 -0
- package/dist/tools/bridgeStatus.d.ts +1 -0
- package/dist/tools/cancelClaudeTask.d.ts +1 -0
- package/dist/tools/checkDocumentDirty.d.ts +1 -0
- package/dist/tools/clipboard.d.ts +2 -0
- package/dist/tools/closeTabs.d.ts +2 -0
- package/dist/tools/codeLens.d.ts +1 -0
- package/dist/tools/contextBundle.d.ts +1 -0
- package/dist/tools/createIssueFromAIComment.d.ts +1 -0
- package/dist/tools/createLinearIssue.d.ts +1 -0
- package/dist/tools/ctxGetTaskContext.d.ts +1 -0
- package/dist/tools/ctxQueryTraces.d.ts +1 -0
- package/dist/tools/ctxSaveTrace.d.ts +1 -0
- package/dist/tools/debug.d.ts +4 -0
- package/dist/tools/decorations.d.ts +2 -0
- package/dist/tools/documentLinks.d.ts +1 -0
- package/dist/tools/editText.d.ts +1 -0
- package/dist/tools/enrichCommit.d.ts +1 -0
- package/dist/tools/enrichStackTrace.d.ts +1 -0
- package/dist/tools/explainDiagnostic.d.ts +1 -0
- package/dist/tools/explainSymbol.d.ts +1 -0
- package/dist/tools/fetchCalendarEvents.d.ts +1 -0
- package/dist/tools/fetchGithubIssue.d.ts +1 -0
- package/dist/tools/fetchGithubPR.d.ts +1 -0
- package/dist/tools/fetchLinearIssue.d.ts +1 -0
- package/dist/tools/fetchSentryIssue.d.ts +1 -0
- package/dist/tools/fetchSlackProfile.d.ts +1 -0
- package/dist/tools/fileOperations.d.ts +3 -0
- package/dist/tools/fileWatcher.d.ts +2 -0
- package/dist/tools/findFiles.d.ts +1 -0
- package/dist/tools/findRelatedTests.d.ts +1 -0
- package/dist/tools/fixAllLintErrors.d.ts +1 -0
- package/dist/tools/foldingRanges.d.ts +1 -0
- package/dist/tools/formatDocument.d.ts +1 -0
- package/dist/tools/generateTests.d.ts +1 -0
- package/dist/tools/getAIComments.d.ts +1 -0
- package/dist/tools/getAnalyticsReport.d.ts +1 -0
- package/dist/tools/getArchitectureContext.d.ts +1 -0
- package/dist/tools/getBufferContent.d.ts +1 -0
- package/dist/tools/getChangeImpact.d.ts +1 -0
- package/dist/tools/getClaudeTaskStatus.d.ts +1 -0
- package/dist/tools/getCodeCoverage.d.ts +1 -0
- package/dist/tools/getCommitsForIssue.d.ts +1 -0
- package/dist/tools/getConnectorStatus.d.ts +1 -0
- package/dist/tools/getCurrentSelection.d.ts +2 -0
- package/dist/tools/getDebugState.d.ts +1 -0
- package/dist/tools/getDependencyTree.d.ts +1 -0
- package/dist/tools/getDiagnostics.d.ts +1 -0
- package/dist/tools/getDiffFromHandoff.d.ts +1 -0
- package/dist/tools/getDocumentSymbols.d.ts +1 -0
- package/dist/tools/getFileTree.d.ts +1 -0
- package/dist/tools/getGitDiff.d.ts +1 -0
- package/dist/tools/getGitHotspots.d.ts +1 -0
- package/dist/tools/getGitLog.d.ts +1 -0
- package/dist/tools/getGitStatus.d.ts +1 -0
- package/dist/tools/getImportTree.d.ts +1 -0
- package/dist/tools/getImportedSignatures.d.ts +1 -0
- package/dist/tools/getOpenEditors.d.ts +1 -0
- package/dist/tools/getPRTemplate.d.ts +1 -0
- package/dist/tools/getProjectContext.d.ts +1 -0
- package/dist/tools/getProjectInfo.d.ts +1 -0
- package/dist/tools/getSecurityAdvisories.d.ts +1 -0
- package/dist/tools/getSessionUsage.d.ts +1 -0
- package/dist/tools/getSymbolHistory.d.ts +1 -0
- package/dist/tools/getToolCapabilities.d.ts +1 -0
- package/dist/tools/getTypeSignature.d.ts +1 -0
- package/dist/tools/getWorkspaceFolders.d.ts +1 -0
- package/dist/tools/getWorkspaceSettings.d.ts +1 -0
- package/dist/tools/gitHistory.d.ts +2 -0
- package/dist/tools/gitWrite.d.ts +11 -0
- package/dist/tools/github/actions.d.ts +2 -0
- package/dist/tools/github/composite.d.ts +3 -0
- package/dist/tools/github/issues.d.ts +4 -0
- package/dist/tools/github/pr.d.ts +7 -0
- package/dist/tools/handoffNote.d.ts +2 -0
- package/dist/tools/hoverAtCursor.d.ts +1 -0
- package/dist/tools/httpClient.d.ts +2 -0
- package/dist/tools/inlayHints.d.ts +1 -0
- package/dist/tools/launchQuickTask.d.ts +1 -0
- package/dist/tools/listClaudeTasks.d.ts +1 -0
- package/dist/tools/listTerminals.d.ts +1 -0
- package/dist/tools/lsp.d.ts +14 -0
- package/dist/tools/navigateToSymbolByName.d.ts +1 -0
- package/dist/tools/openDiff.d.ts +1 -0
- package/dist/tools/openFile.d.ts +1 -0
- package/dist/tools/openInBrowser.d.ts +1 -0
- package/dist/tools/organizeImports.d.ts +1 -0
- package/dist/tools/performanceReport.d.ts +1 -0
- package/dist/tools/planPersistence.d.ts +5 -0
- package/dist/tools/previewEdit.d.ts +1 -0
- package/dist/tools/refactorAnalyze.d.ts +1 -0
- package/dist/tools/refactorPreview.d.ts +1 -0
- package/dist/tools/replaceBlock.d.ts +1 -0
- package/dist/tools/resumeClaudeTask.d.ts +1 -0
- package/dist/tools/runClaudeTask.d.ts +1 -0
- package/dist/tools/runCommand.d.ts +1 -0
- package/dist/tools/runTests.d.ts +1 -0
- package/dist/tools/saveDocument.d.ts +1 -0
- package/dist/tools/screenshotAndAnnotate.d.ts +1 -0
- package/dist/tools/searchAndReplace.d.ts +1 -0
- package/dist/tools/searchTools.d.ts +1 -0
- package/dist/tools/searchWorkspace.d.ts +1 -0
- package/dist/tools/selectionRanges.d.ts +1 -0
- package/dist/tools/semanticTokens.d.ts +1 -0
- package/dist/tools/setActiveWorkspaceFolder.d.ts +1 -0
- package/dist/tools/signatureHelp.d.ts +1 -0
- package/dist/tools/slackListChannels.d.ts +1 -0
- package/dist/tools/slackPostMessage.d.ts +1 -0
- package/dist/tools/slackPostMessage.js +1 -1
- package/dist/tools/slackPostMessage.js.map +1 -1
- package/dist/tools/terminal.d.ts +6 -0
- package/dist/tools/testTraceToSource.d.ts +1 -0
- package/dist/tools/transaction.d.ts +4 -0
- package/dist/tools/typeHierarchy.d.ts +1 -0
- package/dist/tools/updateLinearIssue.d.ts +1 -0
- package/dist/tools/utils.d.ts +2 -0
- package/dist/tools/utils.js.map +1 -1
- package/dist/tools/vscodeCommands.d.ts +2 -0
- package/dist/tools/vscodeTasks.d.ts +2 -0
- package/dist/tools/workspaceSettings.d.ts +1 -0
- package/package.json +20 -4
- package/templates/recipes/project-health-check.yaml +1 -1
- package/dist/schemas/dry-run-plan.v1.json +0 -139
- package/dist/schemas/recipe.v1.json +0 -684
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/recipes/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AA0B7B,MAAM,OAAO,GAAG,yCAAyC,CAAC;AAC1D,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,SAAS,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/recip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CAAC;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,+BAA+B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAClF,CAAC;IACJ,CAAC;IACD,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACnD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAwB;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WarnFn } from "./types.js";
|
|
2
|
+
export type { RecipeMigration, WarnFn } from "./types.js";
|
|
3
|
+
export { v1Migration } from "./v1.js";
|
|
4
|
+
/** apiVersion produced by the most recent migration. */
|
|
5
|
+
export declare const CURRENT_API_VERSION = "patchwork.sh/v1";
|
|
6
|
+
export interface MigrationResult {
|
|
7
|
+
/** Migrated recipe object. Same reference if no migrations applied. */
|
|
8
|
+
recipe: unknown;
|
|
9
|
+
/** Sequence of "<from> -> <to>" strings describing applied migrations. */
|
|
10
|
+
applied: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Migrate a recipe object up to `CURRENT_API_VERSION`.
|
|
14
|
+
*
|
|
15
|
+
* Behavior:
|
|
16
|
+
* - Non-record inputs are returned as-is with no migrations applied.
|
|
17
|
+
* - Each iteration looks for a registered migration whose `from`
|
|
18
|
+
* matches the current `apiVersion` and applies it.
|
|
19
|
+
* - The loop stops when the recipe declares `CURRENT_API_VERSION`,
|
|
20
|
+
* when no matching migration exists for an unversioned recipe (no-op),
|
|
21
|
+
* or when the recipe declares an unknown future apiVersion (passed
|
|
22
|
+
* through unchanged so downstream schema lint can flag it).
|
|
23
|
+
*/
|
|
24
|
+
export declare function migrateRecipeToCurrent(recipe: unknown, warn?: WarnFn): MigrationResult;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { v1Migration } from "./v1.js";
|
|
2
|
+
export { v1Migration } from "./v1.js";
|
|
3
|
+
/** apiVersion produced by the most recent migration. */
|
|
4
|
+
export const CURRENT_API_VERSION = "patchwork.sh/v1";
|
|
5
|
+
/**
|
|
6
|
+
* Ordered list of available migrations. Each step's `to` is consumed
|
|
7
|
+
* by the next step's `from` (or matches `CURRENT_API_VERSION`).
|
|
8
|
+
*/
|
|
9
|
+
const REGISTRY = [v1Migration];
|
|
10
|
+
function isRecord(value) {
|
|
11
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
|
+
}
|
|
13
|
+
function readApiVersion(recipe) {
|
|
14
|
+
return typeof recipe.apiVersion === "string" ? recipe.apiVersion : null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Migrate a recipe object up to `CURRENT_API_VERSION`.
|
|
18
|
+
*
|
|
19
|
+
* Behavior:
|
|
20
|
+
* - Non-record inputs are returned as-is with no migrations applied.
|
|
21
|
+
* - Each iteration looks for a registered migration whose `from`
|
|
22
|
+
* matches the current `apiVersion` and applies it.
|
|
23
|
+
* - The loop stops when the recipe declares `CURRENT_API_VERSION`,
|
|
24
|
+
* when no matching migration exists for an unversioned recipe (no-op),
|
|
25
|
+
* or when the recipe declares an unknown future apiVersion (passed
|
|
26
|
+
* through unchanged so downstream schema lint can flag it).
|
|
27
|
+
*/
|
|
28
|
+
export function migrateRecipeToCurrent(recipe, warn) {
|
|
29
|
+
if (!isRecord(recipe)) {
|
|
30
|
+
return { recipe, applied: [] };
|
|
31
|
+
}
|
|
32
|
+
let current = { ...recipe };
|
|
33
|
+
const applied = [];
|
|
34
|
+
// Bound the loop defensively so a malformed registry can never
|
|
35
|
+
// produce an infinite cycle.
|
|
36
|
+
const maxIterations = REGISTRY.length + 1;
|
|
37
|
+
for (let i = 0; i < maxIterations; i++) {
|
|
38
|
+
const version = readApiVersion(current);
|
|
39
|
+
if (version === CURRENT_API_VERSION) {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
const migration = REGISTRY.find((m) => m.from === version);
|
|
43
|
+
if (!migration) {
|
|
44
|
+
// Unknown future/unsupported apiVersion: leave the recipe alone
|
|
45
|
+
// and let schema lint surface the enum mismatch with a clear
|
|
46
|
+
// message instead of throwing here.
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
const next = migration.migrate(current, warn);
|
|
50
|
+
current = isRecord(next) ? next : current;
|
|
51
|
+
applied.push(`${migration.from ?? "(unversioned)"} -> ${migration.to}`);
|
|
52
|
+
}
|
|
53
|
+
return { recipe: current, applied };
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/recipes/migrations/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,wDAAwD;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAErD;;;GAGG;AACH,MAAM,QAAQ,GAAmC,CAAC,WAAW,CAAC,CAAC;AAS/D,SAAS,QAAQ,CAAC,KAAc;IAC9B,O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,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1C,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,IAAI,eAAe,OAAO,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recipe apiVersion migration layer.
|
|
3
|
+
*
|
|
4
|
+
* A `RecipeMigration` upgrades a recipe object from one declared
|
|
5
|
+
* `apiVersion` to the next. Migrations are chained by the registry in
|
|
6
|
+
* `./index.ts` until the recipe carries the current apiVersion or no
|
|
7
|
+
* matching migration exists.
|
|
8
|
+
*
|
|
9
|
+
* Field-level legacy compatibility (e.g. `output -> into`,
|
|
10
|
+
* `params` flattening, `trigger.schedule -> trigger.at`) lives in
|
|
11
|
+
* `../legacyRecipeCompat.ts` and runs alongside this layer; migrations
|
|
12
|
+
* here are reserved for changes that are explicitly version-bumped.
|
|
13
|
+
*/
|
|
14
|
+
export type WarnFn = (msg: string) => void;
|
|
15
|
+
export interface RecipeMigration {
|
|
16
|
+
/**
|
|
17
|
+
* apiVersion this migration consumes. `null` means "no apiVersion
|
|
18
|
+
* field present" (i.e. an unversioned legacy recipe).
|
|
19
|
+
*/
|
|
20
|
+
from: string | null;
|
|
21
|
+
/** apiVersion this migration produces. */
|
|
22
|
+
to: string;
|
|
23
|
+
/**
|
|
24
|
+
* Migrate a shallow-cloned record. Implementations should return a
|
|
25
|
+
* new object rather than mutating the input.
|
|
26
|
+
*/
|
|
27
|
+
migrate: (recipe: Record<string, unknown>, warn?: WarnFn) => Record<string, unknown>;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/recipes/migrations/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecipeMigration } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Migrate an unversioned (no `apiVersion`) recipe to `patchwork.sh/v1`.
|
|
4
|
+
*
|
|
5
|
+
* The shape changes that distinguished pre-v1 from v1 (e.g. flat
|
|
6
|
+
* `agent: true`, `params`, `output`, `trigger.schedule`) are still
|
|
7
|
+
* accepted at runtime and lint via `../legacyRecipeCompat.ts`. This
|
|
8
|
+
* migration's job is the explicit version stamp plus a single
|
|
9
|
+
* deprecation warning telling authors to add `apiVersion` themselves.
|
|
10
|
+
*/
|
|
11
|
+
export declare const v1Migration: RecipeMigration;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migrate an unversioned (no `apiVersion`) recipe to `patchwork.sh/v1`.
|
|
3
|
+
*
|
|
4
|
+
* The shape changes that distinguished pre-v1 from v1 (e.g. flat
|
|
5
|
+
* `agent: true`, `params`, `output`, `trigger.schedule`) are still
|
|
6
|
+
* accepted at runtime and lint via `../legacyRecipeCompat.ts`. This
|
|
7
|
+
* migration's job is the explicit version stamp plus a single
|
|
8
|
+
* deprecation warning telling authors to add `apiVersion` themselves.
|
|
9
|
+
*/
|
|
10
|
+
export const v1Migration = {
|
|
11
|
+
from: null,
|
|
12
|
+
to: "patchwork.sh/v1",
|
|
13
|
+
migrate(recipe, warn) {
|
|
14
|
+
warn?.("Recipe missing 'apiVersion' — implicitly migrated to 'patchwork.sh/v1'. Add `apiVersion: patchwork.sh/v1` to silence this warning (will be required in a future major version).");
|
|
15
|
+
return { apiVersion: "patchwork.sh/v1", ...recipe };
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=v1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../../../src/recipes/migrations/v1.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAoB;IAC1C,IAAI,EAAE,IAAI;IACV,EAAE,EAAE,iBAAiB;IACrB,OAAO,CAAC,MAA+B,EAAE,IAA4B;QACnE,IAAI,EAAE,CACJ,iLAAiL,CAClL,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAAC;IACtD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* replayRun — VD-4 mocked replay entrypoint.
|
|
3
|
+
*
|
|
4
|
+
* Given an original `RecipeRun` (looked up from `RecipeRunLog`), build a
|
|
5
|
+
* `mockedOutputs` map from each step's captured `output` (VD-2) and
|
|
6
|
+
* re-run the recipe through `runChainedRecipe` with all tool/agent
|
|
7
|
+
* execution short-circuited to those captured values.
|
|
8
|
+
*
|
|
9
|
+
* Pure mocked-only: no external network calls, no write side effects.
|
|
10
|
+
* The new run is logged with `triggerSource: "replay:<originalSeq>"`
|
|
11
|
+
* so the audit trail is clear.
|
|
12
|
+
*
|
|
13
|
+
* Real-mode replay (write tools really fire) is deliberately NOT in
|
|
14
|
+
* this module. It needs a confirmation UX, a kill-switch interaction,
|
|
15
|
+
* and possibly a connector-level read/write split. Ship separately
|
|
16
|
+
* after explicit user approval.
|
|
17
|
+
*/
|
|
18
|
+
import type { ActivityLog } from "../activityLog.js";
|
|
19
|
+
import type { RecipeRun, RecipeRunLog } from "../runLog.js";
|
|
20
|
+
import type { ChainedRecipe, ChainedRunResult } from "./chainedRunner.js";
|
|
21
|
+
import type { RunnerDeps } from "./yamlRunner.js";
|
|
22
|
+
export interface ReplayDeps {
|
|
23
|
+
/** Long-lived run log so the new run shows up live in the dashboard. */
|
|
24
|
+
runLog: RecipeRunLog;
|
|
25
|
+
/** Activity log for live-tail SSE on the new run. Optional. */
|
|
26
|
+
activityLog?: ActivityLog;
|
|
27
|
+
/** Workdir + claudeCodeFn etc., reused from the orchestrator. */
|
|
28
|
+
runnerDeps: RunnerDeps;
|
|
29
|
+
}
|
|
30
|
+
export interface ReplayResult {
|
|
31
|
+
ok: boolean;
|
|
32
|
+
/** New run's seq if the replay started successfully. */
|
|
33
|
+
newSeq?: number;
|
|
34
|
+
/** Underlying recipe-run result for callers that want full detail. */
|
|
35
|
+
result?: ChainedRunResult;
|
|
36
|
+
error?: string;
|
|
37
|
+
/** Steps that lacked captured outputs and were dropped from the
|
|
38
|
+
* mocked map. The replay still runs but those steps fall through to
|
|
39
|
+
* REAL execution — callers may want to surface this as a warning. */
|
|
40
|
+
unmockedSteps?: string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Build the `mockedOutputs` map. Truncated captures (>8 KB envelope from
|
|
44
|
+
* VD-2's `captureForRunlog`) are excluded — replaying with a `[truncated]`
|
|
45
|
+
* preview would be misleading. Steps without captures are excluded too.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildMockedOutputs(originalRun: RecipeRun): {
|
|
48
|
+
outputs: Map<string, unknown>;
|
|
49
|
+
unmocked: string[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Fire a mocked replay of `originalRun` against `recipe`. The recipe
|
|
53
|
+
* argument is supplied by the caller (typically loaded fresh from disk
|
|
54
|
+
* by name) so an EDITED recipe can be replayed against captured
|
|
55
|
+
* outputs — that's the debugging value of replay.
|
|
56
|
+
*/
|
|
57
|
+
export declare function replayMockedRun(opts: {
|
|
58
|
+
originalRun: RecipeRun;
|
|
59
|
+
recipe: ChainedRecipe;
|
|
60
|
+
sourcePath?: string;
|
|
61
|
+
deps: ReplayDeps;
|
|
62
|
+
}): Promise<ReplayResult>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* replayRun — VD-4 mocked replay entrypoint.
|
|
3
|
+
*
|
|
4
|
+
* Given an original `RecipeRun` (looked up from `RecipeRunLog`), build a
|
|
5
|
+
* `mockedOutputs` map from each step's captured `output` (VD-2) and
|
|
6
|
+
* re-run the recipe through `runChainedRecipe` with all tool/agent
|
|
7
|
+
* execution short-circuited to those captured values.
|
|
8
|
+
*
|
|
9
|
+
* Pure mocked-only: no external network calls, no write side effects.
|
|
10
|
+
* The new run is logged with `triggerSource: "replay:<originalSeq>"`
|
|
11
|
+
* so the audit trail is clear.
|
|
12
|
+
*
|
|
13
|
+
* Real-mode replay (write tools really fire) is deliberately NOT in
|
|
14
|
+
* this module. It needs a confirmation UX, a kill-switch interaction,
|
|
15
|
+
* and possibly a connector-level read/write split. Ship separately
|
|
16
|
+
* after explicit user approval.
|
|
17
|
+
*/
|
|
18
|
+
import { runChainedRecipe } from "./chainedRunner.js";
|
|
19
|
+
import { buildChainedDeps } from "./yamlRunner.js";
|
|
20
|
+
/**
|
|
21
|
+
* Build the `mockedOutputs` map. Truncated captures (>8 KB envelope from
|
|
22
|
+
* VD-2's `captureForRunlog`) are excluded — replaying with a `[truncated]`
|
|
23
|
+
* preview would be misleading. Steps without captures are excluded too.
|
|
24
|
+
*/
|
|
25
|
+
export function buildMockedOutputs(originalRun) {
|
|
26
|
+
const outputs = new Map();
|
|
27
|
+
const unmocked = [];
|
|
28
|
+
for (const step of originalRun.stepResults ?? []) {
|
|
29
|
+
if (step.status === "skipped")
|
|
30
|
+
continue;
|
|
31
|
+
const out = step.output;
|
|
32
|
+
if (out === undefined) {
|
|
33
|
+
unmocked.push(step.id);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
// Skip the truncation envelope — replaying with a preview slice
|
|
37
|
+
// would be misleading.
|
|
38
|
+
if (out !== null &&
|
|
39
|
+
typeof out === "object" &&
|
|
40
|
+
out["[truncated]"] === true) {
|
|
41
|
+
unmocked.push(step.id);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
outputs.set(step.id, out);
|
|
45
|
+
}
|
|
46
|
+
return { outputs, unmocked };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Fire a mocked replay of `originalRun` against `recipe`. The recipe
|
|
50
|
+
* argument is supplied by the caller (typically loaded fresh from disk
|
|
51
|
+
* by name) so an EDITED recipe can be replayed against captured
|
|
52
|
+
* outputs — that's the debugging value of replay.
|
|
53
|
+
*/
|
|
54
|
+
export async function replayMockedRun(opts) {
|
|
55
|
+
const { originalRun, recipe, sourcePath, deps } = opts;
|
|
56
|
+
const { outputs, unmocked } = buildMockedOutputs(originalRun);
|
|
57
|
+
const chainedDeps = buildChainedDeps(deps.runnerDeps, deps.runnerDeps.claudeCodeFn ??
|
|
58
|
+
(async () => {
|
|
59
|
+
return "";
|
|
60
|
+
}));
|
|
61
|
+
const runOptions = {
|
|
62
|
+
env: { ...process.env },
|
|
63
|
+
maxConcurrency: recipe.maxConcurrency ?? 4,
|
|
64
|
+
maxDepth: recipe.maxDepth ?? 3,
|
|
65
|
+
dryRun: false,
|
|
66
|
+
...(sourcePath !== undefined && { sourcePath }),
|
|
67
|
+
runLog: deps.runLog,
|
|
68
|
+
...(deps.activityLog !== undefined && { activityLog: deps.activityLog }),
|
|
69
|
+
mockedOutputs: outputs,
|
|
70
|
+
// BUG-4 fix: tag the new run's taskId so it's distinguishable from a
|
|
71
|
+
// fresh run. Searchable as `taskId LIKE 'replay:<seq>:%'`.
|
|
72
|
+
taskIdPrefix: `replay:${originalRun.seq}`,
|
|
73
|
+
};
|
|
74
|
+
try {
|
|
75
|
+
const result = await runChainedRecipe(recipe, runOptions, chainedDeps);
|
|
76
|
+
// The runner's completeRun path will have already written the new
|
|
77
|
+
// run to the log. Find its seq — most-recent matching recipeName,
|
|
78
|
+
// started after originalRun.doneAt.
|
|
79
|
+
const recent = deps.runLog.query({ recipe: recipe.name, limit: 5 });
|
|
80
|
+
const newRun = recent.find((r) => r.createdAt > originalRun.doneAt);
|
|
81
|
+
return {
|
|
82
|
+
ok: result.success,
|
|
83
|
+
...(newRun?.seq !== undefined && { newSeq: newRun.seq }),
|
|
84
|
+
result,
|
|
85
|
+
...(result.errorMessage !== undefined && { error: result.errorMessage }),
|
|
86
|
+
...(unmocked.length > 0 && { unmockedSteps: unmocked }),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
error: err instanceof Error ? err.message : String(err),
|
|
93
|
+
...(unmocked.length > 0 && { unmockedSteps: unmocked }),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=replayRun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replayRun.js","sourceRoot":"","sources":["../../src/recipes/replayRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAwBnD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAsB;IAIvD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC3C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;QACjD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,SAAS;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;QACxB,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvB,SAAS;QACX,CAAC;QACD,gEAAgE;QAChE,uBAAuB;QACvB,IACE,GAAG,KAAK,IAAI;YACZ,OAAO,GAAG,KAAK,QAAQ;YACtB,GAA+B,CAAC,aAAa,CAAC,KAAK,IAAI,EACxD,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvB,SAAS;QACX,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CA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AM,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACpE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACpE,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,OAAO;YAClB,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;YACxD,MAAM;YACN,GAAG,CAAC,MAAM,CAAC,YAAY,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;YACxE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;SACxD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;YACvD,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;SACxD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { readdirSync, readFileSync } from "node:fs";
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import cron from "node-cron";
|
|
4
4
|
import { parse as parseYaml } from "yaml";
|
|
5
5
|
import { loadConfig } from "../patchworkConfig.js";
|
|
6
6
|
import { findYamlRecipePath, loadRecipePrompt } from "../recipesHttp.js";
|
|
7
|
+
/**
|
|
8
|
+
* Per-recipe disabled marker — must match the constant in
|
|
9
|
+
* src/commands/recipeInstall.ts (kept inline here to avoid a circular
|
|
10
|
+
* import via commands → recipes back to commands).
|
|
11
|
+
*/
|
|
12
|
+
const DISABLED_MARKER = ".disabled";
|
|
7
13
|
export class RecipeScheduler {
|
|
8
14
|
opts;
|
|
9
15
|
scheduled = [];
|
|
@@ -34,17 +40,79 @@ export class RecipeScheduler {
|
|
|
34
40
|
catch {
|
|
35
41
|
return [];
|
|
36
42
|
}
|
|
43
|
+
const candidates = [];
|
|
37
44
|
for (const f of entries) {
|
|
45
|
+
const fullPath = path.join(this.opts.recipesDir, f);
|
|
46
|
+
let isDir = false;
|
|
47
|
+
try {
|
|
48
|
+
isDir = statSync(fullPath).isDirectory();
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (isDir) {
|
|
54
|
+
// Honor the per-recipe `.disabled` marker written by recipeInstall.
|
|
55
|
+
if (existsSync(path.join(fullPath, DISABLED_MARKER))) {
|
|
56
|
+
this.opts.logger?.info?.(`[scheduler] skipping recipe in "${f}" — .disabled marker present`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
// Locate the recipe entrypoint inside the install dir.
|
|
60
|
+
// Prefer recipe.json's `recipes.main`, then fall back to first YAML.
|
|
61
|
+
const manifestPath = path.join(fullPath, "recipe.json");
|
|
62
|
+
let entrypoint = null;
|
|
63
|
+
if (existsSync(manifestPath)) {
|
|
64
|
+
try {
|
|
65
|
+
const m = JSON.parse(readFileSync(manifestPath, "utf-8"));
|
|
66
|
+
if (m.recipes?.main) {
|
|
67
|
+
const candidate = path.join(fullPath, m.recipes.main);
|
|
68
|
+
if (existsSync(candidate))
|
|
69
|
+
entrypoint = candidate;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
// Malformed manifest — fall through to first-yaml fallback,
|
|
74
|
+
// but surface the issue so the user can fix it. Silent failures
|
|
75
|
+
// here led to "why isn't my recipe firing?" confusion.
|
|
76
|
+
this.opts.logger?.warn?.(`[scheduler] could not parse recipe.json in "${f}" — ${err instanceof Error ? err.message : String(err)}; falling back to first-yaml lookup`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (!entrypoint) {
|
|
80
|
+
try {
|
|
81
|
+
const yaml = readdirSync(fullPath).find((x) => /\.ya?ml$/i.test(x));
|
|
82
|
+
if (yaml)
|
|
83
|
+
entrypoint = path.join(fullPath, yaml);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// unreadable — skip
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (entrypoint) {
|
|
90
|
+
const ext = path.extname(entrypoint).toLowerCase();
|
|
91
|
+
candidates.push({
|
|
92
|
+
filePath: entrypoint,
|
|
93
|
+
kind: ext === ".json" ? "json" : "yaml",
|
|
94
|
+
installDir: fullPath,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
38
99
|
const isJson = f.endsWith(".json") && !f.endsWith(".permissions.json");
|
|
39
100
|
const isYaml = f.endsWith(".yaml") || f.endsWith(".yml");
|
|
40
101
|
if (!isJson && !isYaml)
|
|
41
102
|
continue;
|
|
42
|
-
|
|
103
|
+
candidates.push({
|
|
104
|
+
filePath: fullPath,
|
|
105
|
+
kind: isJson ? "json" : "yaml",
|
|
106
|
+
installDir: null,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
for (const cand of candidates) {
|
|
110
|
+
const f = path.basename(cand.filePath);
|
|
43
111
|
try {
|
|
44
112
|
let name;
|
|
45
113
|
let schedule;
|
|
46
|
-
if (
|
|
47
|
-
const raw = readFileSync(
|
|
114
|
+
if (cand.kind === "json") {
|
|
115
|
+
const raw = readFileSync(cand.filePath, "utf-8");
|
|
48
116
|
const parsed = JSON.parse(raw);
|
|
49
117
|
if (parsed.trigger?.type !== "cron")
|
|
50
118
|
continue;
|
|
@@ -56,17 +124,16 @@ export class RecipeScheduler {
|
|
|
56
124
|
}
|
|
57
125
|
else {
|
|
58
126
|
// YAML
|
|
59
|
-
const raw = readFileSync(
|
|
127
|
+
const raw = readFileSync(cand.filePath, "utf-8");
|
|
60
128
|
const parsed = parseYaml(raw);
|
|
61
129
|
if (parsed.trigger?.type !== "cron")
|
|
62
130
|
continue;
|
|
63
131
|
schedule = parsed.trigger.at ?? parsed.trigger.schedule;
|
|
64
132
|
if (!schedule || typeof schedule !== "string")
|
|
65
133
|
continue;
|
|
66
|
-
name =
|
|
67
|
-
parsed.name ?? path.basename(f, isYaml ? path.extname(f) : ".yaml");
|
|
134
|
+
name = parsed.name ?? path.basename(f, path.extname(f));
|
|
68
135
|
}
|
|
69
|
-
// Apply disabled
|
|
136
|
+
// Apply config-file disabled list (legacy mechanism)
|
|
70
137
|
if (disabled.has(name)) {
|
|
71
138
|
this.opts.logger?.info?.(`[scheduler] skipping disabled recipe "${name}"`);
|
|
72
139
|
continue;
|
|
@@ -110,8 +177,10 @@ export class RecipeScheduler {
|
|
|
110
177
|
this.opts.logger?.info?.(`[scheduler] "${name}" scheduled with cron expression "${schedule}"`);
|
|
111
178
|
}
|
|
112
179
|
}
|
|
113
|
-
catch {
|
|
114
|
-
//
|
|
180
|
+
catch (err) {
|
|
181
|
+
// Malformed recipe file — surface so users can debug rather than
|
|
182
|
+
// silently dropping the recipe from the schedule.
|
|
183
|
+
this.opts.logger?.warn?.(`[scheduler] could not load recipe at "${cand.filePath}" — ${err instanceof Error ? err.message : String(err)}; recipe will not be scheduled`);
|
|
115
184
|
}
|
|
116
185
|
}
|
|
117
186
|
return this.scheduled;
|
|
@@ -139,6 +208,24 @@ export class RecipeScheduler {
|
|
|
139
208
|
this.fire(name);
|
|
140
209
|
}
|
|
141
210
|
fire(name) {
|
|
211
|
+
// TOCTOU defence: re-check the legacy `cfg.recipes.disabled` list at
|
|
212
|
+
// fire time. `start()` snapshots it once; if the user runs `recipe
|
|
213
|
+
// disable <name>` after start (and the recipe is a top-level legacy
|
|
214
|
+
// file, where the marker file doesn't apply), the timer would
|
|
215
|
+
// otherwise still fire until next restart(). The `.disabled` marker
|
|
216
|
+
// case is handled inside findYamlRecipePath / loadRecipePrompt
|
|
217
|
+
// (skip disabled install dirs) thanks to PR #49.
|
|
218
|
+
try {
|
|
219
|
+
const cfg = loadConfig();
|
|
220
|
+
const disabled = new Set(cfg.recipes?.disabled ?? []);
|
|
221
|
+
if (disabled.has(name)) {
|
|
222
|
+
this.opts.logger?.info?.(`[scheduler] skipping "${name}" — disabled via config (TOCTOU re-check)`);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
// proceed if config unreadable — falling back to scan-time snapshot
|
|
228
|
+
}
|
|
142
229
|
// YAML recipe — delegate to runYaml if provided
|
|
143
230
|
const yamlPath = findYamlRecipePath(this.opts.recipesDir, name);
|
|
144
231
|
if (yamlPath) {
|
|
@@ -155,7 +242,11 @@ export class RecipeScheduler {
|
|
|
155
242
|
// JSON recipe — legacy path
|
|
156
243
|
const loaded = loadRecipePrompt(this.opts.recipesDir, name);
|
|
157
244
|
if (!loaded) {
|
|
158
|
-
|
|
245
|
+
// After PR #49, findYamlRecipePath / loadRecipePrompt return null for
|
|
246
|
+
// recipes whose install dir has a `.disabled` marker — that's the
|
|
247
|
+
// common case here. "Disappeared" was misleading; prefer a message
|
|
248
|
+
// that names both possibilities.
|
|
249
|
+
this.opts.logger?.warn?.(`[scheduler] skipped "${name}" — recipe not found or disabled`);
|
|
159
250
|
return;
|
|
160
251
|
}
|
|
161
252
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../src/recipes/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../src/recipes/scheduler.ts"],"names":[],"mappings":"AAAA,OA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CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -51,7 +51,7 @@ export function generateDryRunPlanSchema() {
|
|
|
51
51
|
};
|
|
52
52
|
return {
|
|
53
53
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
54
|
-
$id: "https://
|
|
54
|
+
$id: "https://raw.githubusercontent.com/patchworkos/recipes/main/schema/dry-run-plan.v1.json",
|
|
55
55
|
title: "Patchwork Recipe Dry-Run Plan",
|
|
56
56
|
description: "Stable machine-readable output of `patchwork recipe run --dry-run`. Pin consumers on schemaVersion.",
|
|
57
57
|
type: "object",
|
|
@@ -240,7 +240,7 @@ function generateRecipeSchema(namespaceSchemas) {
|
|
|
240
240
|
};
|
|
241
241
|
return {
|
|
242
242
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
243
|
-
$id: "https://
|
|
243
|
+
$id: "https://raw.githubusercontent.com/patchworkos/recipes/main/schema/recipe.v1.json",
|
|
244
244
|
title: "Patchwork Recipe",
|
|
245
245
|
description: "YAML recipe schema for Patchwork automation",
|
|
246
246
|
// taplo formatter: auto-associates *.patchwork.yaml files
|
|
@@ -506,7 +506,7 @@ function generateNamespaceSchema(namespace) {
|
|
|
506
506
|
}
|
|
507
507
|
return {
|
|
508
508
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
509
|
-
$id: `https://
|
|
509
|
+
$id: `https://raw.githubusercontent.com/patchworkos/recipes/main/schema/tools/${namespace}.json`,
|
|
510
510
|
title: `${capitalize(namespace)} Tools`,
|
|
511
511
|
description: `Tool parameters for ${namespace} namespace`,
|
|
512
512
|
definitions,
|