rowbound 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +258 -0
  3. package/dist/adapters/adapter.d.ts +1 -0
  4. package/dist/adapters/adapter.js +1 -0
  5. package/dist/adapters/sheets/sheets-adapter.d.ts +66 -0
  6. package/dist/adapters/sheets/sheets-adapter.js +531 -0
  7. package/dist/cli/config.d.ts +2 -0
  8. package/dist/cli/config.js +397 -0
  9. package/dist/cli/env.d.ts +3 -0
  10. package/dist/cli/env.js +103 -0
  11. package/dist/cli/format.d.ts +5 -0
  12. package/dist/cli/format.js +6 -0
  13. package/dist/cli/index.d.ts +2 -0
  14. package/dist/cli/index.js +39 -0
  15. package/dist/cli/init.d.ts +10 -0
  16. package/dist/cli/init.js +72 -0
  17. package/dist/cli/run.d.ts +2 -0
  18. package/dist/cli/run.js +212 -0
  19. package/dist/cli/runs.d.ts +2 -0
  20. package/dist/cli/runs.js +108 -0
  21. package/dist/cli/status.d.ts +2 -0
  22. package/dist/cli/status.js +108 -0
  23. package/dist/cli/sync.d.ts +2 -0
  24. package/dist/cli/sync.js +84 -0
  25. package/dist/cli/watch.d.ts +2 -0
  26. package/dist/cli/watch.js +348 -0
  27. package/dist/core/condition.d.ts +25 -0
  28. package/dist/core/condition.js +66 -0
  29. package/dist/core/defaults.d.ts +3 -0
  30. package/dist/core/defaults.js +7 -0
  31. package/dist/core/engine.d.ts +50 -0
  32. package/dist/core/engine.js +234 -0
  33. package/dist/core/env.d.ts +13 -0
  34. package/dist/core/env.js +72 -0
  35. package/dist/core/exec.d.ts +24 -0
  36. package/dist/core/exec.js +134 -0
  37. package/dist/core/extractor.d.ts +10 -0
  38. package/dist/core/extractor.js +33 -0
  39. package/dist/core/http-client.d.ts +32 -0
  40. package/dist/core/http-client.js +161 -0
  41. package/dist/core/rate-limiter.d.ts +25 -0
  42. package/dist/core/rate-limiter.js +64 -0
  43. package/dist/core/reconcile.d.ts +24 -0
  44. package/dist/core/reconcile.js +192 -0
  45. package/dist/core/run-format.d.ts +39 -0
  46. package/dist/core/run-format.js +201 -0
  47. package/dist/core/run-state.d.ts +64 -0
  48. package/dist/core/run-state.js +141 -0
  49. package/dist/core/run-tracker.d.ts +15 -0
  50. package/dist/core/run-tracker.js +57 -0
  51. package/dist/core/safe-compare.d.ts +8 -0
  52. package/dist/core/safe-compare.js +19 -0
  53. package/dist/core/shell-escape.d.ts +7 -0
  54. package/dist/core/shell-escape.js +9 -0
  55. package/dist/core/tab-resolver.d.ts +17 -0
  56. package/dist/core/tab-resolver.js +44 -0
  57. package/dist/core/template.d.ts +32 -0
  58. package/dist/core/template.js +82 -0
  59. package/dist/core/types.d.ts +105 -0
  60. package/dist/core/types.js +2 -0
  61. package/dist/core/url-guard.d.ts +21 -0
  62. package/dist/core/url-guard.js +184 -0
  63. package/dist/core/validator.d.ts +11 -0
  64. package/dist/core/validator.js +261 -0
  65. package/dist/core/waterfall.d.ts +26 -0
  66. package/dist/core/waterfall.js +55 -0
  67. package/dist/index.d.ts +15 -0
  68. package/dist/index.js +16 -0
  69. package/dist/mcp/server.d.ts +1 -0
  70. package/dist/mcp/server.js +943 -0
  71. package/package.json +67 -0
@@ -0,0 +1,26 @@
1
+ import type { RateLimiter } from "./rate-limiter.js";
2
+ import { type OnMissingCallback } from "./template.js";
3
+ import type { ExecutionContext, WaterfallAction } from "./types.js";
4
+ export interface WaterfallResult {
5
+ value: string;
6
+ provider: string;
7
+ }
8
+ /**
9
+ * Execute a waterfall action: try each provider in order until one succeeds.
10
+ *
11
+ * For each provider:
12
+ * 1. Resolve templates in url, headers, body
13
+ * 2. Make HTTP request
14
+ * 3. Extract value from response
15
+ * 4. Return first non-empty result
16
+ *
17
+ * StopProviderError and other errors cause the provider to be skipped.
18
+ * Returns null if no provider produces a value.
19
+ */
20
+ export declare function executeWaterfall(action: WaterfallAction, context: ExecutionContext, options?: {
21
+ rateLimiter?: RateLimiter;
22
+ retryAttempts?: number;
23
+ retryBackoff?: string;
24
+ signal?: AbortSignal;
25
+ onMissing?: OnMissingCallback;
26
+ }): Promise<WaterfallResult | null>;
@@ -0,0 +1,55 @@
1
+ import { extractValue } from "./extractor.js";
2
+ import { httpRequest } from "./http-client.js";
3
+ import { resolveObject, resolveTemplate, } from "./template.js";
4
+ /**
5
+ * Execute a waterfall action: try each provider in order until one succeeds.
6
+ *
7
+ * For each provider:
8
+ * 1. Resolve templates in url, headers, body
9
+ * 2. Make HTTP request
10
+ * 3. Extract value from response
11
+ * 4. Return first non-empty result
12
+ *
13
+ * StopProviderError and other errors cause the provider to be skipped.
14
+ * Returns null if no provider produces a value.
15
+ */
16
+ export async function executeWaterfall(action, context, options = {}) {
17
+ for (const provider of action.providers) {
18
+ try {
19
+ const resolvedUrl = resolveTemplate(provider.url, context, options.onMissing);
20
+ const resolvedHeaders = provider.headers
21
+ ? resolveObject(provider.headers, context, options.onMissing)
22
+ : undefined;
23
+ const resolvedBody = provider.body !== undefined
24
+ ? resolveObject(provider.body, context, options.onMissing)
25
+ : undefined;
26
+ const response = await httpRequest({
27
+ method: provider.method,
28
+ url: resolvedUrl,
29
+ headers: resolvedHeaders,
30
+ body: resolvedBody,
31
+ retryAttempts: options.retryAttempts,
32
+ retryBackoff: options.retryBackoff,
33
+ onError: provider.onError,
34
+ rateLimiter: options.rateLimiter,
35
+ signal: options.signal,
36
+ });
37
+ if (response === null) {
38
+ // Request was skipped (e.g., onError: "skip") — try next provider
39
+ continue;
40
+ }
41
+ const value = extractValue(response.data, provider.extract);
42
+ if (value !== "") {
43
+ return { value, provider: provider.name };
44
+ }
45
+ // Empty extraction — try next provider
46
+ }
47
+ catch (error) {
48
+ // Propagate abort errors — do not try remaining providers
49
+ if (error instanceof Error && error.message === "Request aborted") {
50
+ throw error;
51
+ }
52
+ }
53
+ }
54
+ return null;
55
+ }
@@ -0,0 +1,15 @@
1
+ export { SheetsAdapter } from "./adapters/sheets/sheets-adapter.js";
2
+ export { evaluateCondition } from "./core/condition.js";
3
+ export { type RunPipelineOptions, type RunResult, runPipeline, } from "./core/engine.js";
4
+ export { type ExecResult, executeCommand, executeExecAction, } from "./core/exec.js";
5
+ export { extractValue } from "./core/extractor.js";
6
+ export { type HttpRequestOptions, type HttpResponse, httpRequest, StopProviderError, } from "./core/http-client.js";
7
+ export { RateLimiter } from "./core/rate-limiter.js";
8
+ export { type ReconcileResult, reconcile, } from "./core/reconcile.js";
9
+ export { formatAge, formatDuration, formatRunDetail, formatRunList, } from "./core/run-format.js";
10
+ export { type ActionSummary, createRunState, listRuns, pruneRuns, type RunError, type RunState, readRunState, writeRunState, } from "./core/run-state.js";
11
+ export { createRunTracker } from "./core/run-tracker.js";
12
+ export { resolveObject, resolveTemplate } from "./core/template.js";
13
+ export type { Action, Adapter, CellUpdate, ExecAction, HttpAction, OnErrorConfig, PipelineConfig, PipelineSettings, Row, SheetRef, TabConfig, TransformAction, WaterfallAction, WaterfallProvider, } from "./core/types.js";
14
+ export { type ValidationResult, validateConfig, } from "./core/validator.js";
15
+ export { executeWaterfall, type WaterfallResult, } from "./core/waterfall.js";
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ // Rowbound - Google Sheets enrichment engine
2
+ // Re-exports for programmatic usage
3
+ export { SheetsAdapter } from "./adapters/sheets/sheets-adapter.js";
4
+ export { evaluateCondition } from "./core/condition.js";
5
+ export { runPipeline, } from "./core/engine.js";
6
+ export { executeCommand, executeExecAction, } from "./core/exec.js";
7
+ export { extractValue } from "./core/extractor.js";
8
+ export { httpRequest, StopProviderError, } from "./core/http-client.js";
9
+ export { RateLimiter } from "./core/rate-limiter.js";
10
+ export { reconcile, } from "./core/reconcile.js";
11
+ export { formatAge, formatDuration, formatRunDetail, formatRunList, } from "./core/run-format.js";
12
+ export { createRunState, listRuns, pruneRuns, readRunState, writeRunState, } from "./core/run-state.js";
13
+ export { createRunTracker } from "./core/run-tracker.js";
14
+ export { resolveObject, resolveTemplate } from "./core/template.js";
15
+ export { validateConfig, } from "./core/validator.js";
16
+ export { executeWaterfall, } from "./core/waterfall.js";
@@ -0,0 +1 @@
1
+ export declare function startMcpServer(): Promise<void>;