@renseiai/agentfactory 0.8.12 → 0.8.13

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 (101) hide show
  1. package/dist/src/config/repository-config.d.ts +24 -0
  2. package/dist/src/config/repository-config.d.ts.map +1 -1
  3. package/dist/src/config/repository-config.js +21 -0
  4. package/dist/src/config/repository-config.test.js +202 -0
  5. package/dist/src/governor/decision-engine.d.ts +2 -0
  6. package/dist/src/governor/decision-engine.d.ts.map +1 -1
  7. package/dist/src/governor/decision-engine.js +7 -0
  8. package/dist/src/governor/decision-engine.test.js +63 -0
  9. package/dist/src/governor/governor-types.d.ts +2 -1
  10. package/dist/src/governor/governor-types.d.ts.map +1 -1
  11. package/dist/src/index.d.ts +1 -0
  12. package/dist/src/index.d.ts.map +1 -1
  13. package/dist/src/index.js +1 -0
  14. package/dist/src/merge-queue/conflict-resolver.d.ts +62 -0
  15. package/dist/src/merge-queue/conflict-resolver.d.ts.map +1 -0
  16. package/dist/src/merge-queue/conflict-resolver.js +168 -0
  17. package/dist/src/merge-queue/conflict-resolver.test.d.ts +2 -0
  18. package/dist/src/merge-queue/conflict-resolver.test.d.ts.map +1 -0
  19. package/dist/src/merge-queue/conflict-resolver.test.js +405 -0
  20. package/dist/src/merge-queue/lock-file-regeneration.d.ts +14 -0
  21. package/dist/src/merge-queue/lock-file-regeneration.d.ts.map +1 -0
  22. package/dist/src/merge-queue/lock-file-regeneration.js +82 -0
  23. package/dist/src/merge-queue/lock-file-regeneration.test.d.ts +2 -0
  24. package/dist/src/merge-queue/lock-file-regeneration.test.d.ts.map +1 -0
  25. package/dist/src/merge-queue/lock-file-regeneration.test.js +236 -0
  26. package/dist/src/merge-queue/merge-worker.d.ts +79 -0
  27. package/dist/src/merge-queue/merge-worker.d.ts.map +1 -0
  28. package/dist/src/merge-queue/merge-worker.js +221 -0
  29. package/dist/src/merge-queue/merge-worker.test.d.ts +2 -0
  30. package/dist/src/merge-queue/merge-worker.test.d.ts.map +1 -0
  31. package/dist/src/merge-queue/merge-worker.test.js +883 -0
  32. package/dist/src/merge-queue/strategies/index.d.ts +19 -0
  33. package/dist/src/merge-queue/strategies/index.d.ts.map +1 -0
  34. package/dist/src/merge-queue/strategies/index.js +30 -0
  35. package/dist/src/merge-queue/strategies/merge-commit-strategy.d.ts +14 -0
  36. package/dist/src/merge-queue/strategies/merge-commit-strategy.d.ts.map +1 -0
  37. package/dist/src/merge-queue/strategies/merge-commit-strategy.js +58 -0
  38. package/dist/src/merge-queue/strategies/rebase-strategy.d.ts +14 -0
  39. package/dist/src/merge-queue/strategies/rebase-strategy.d.ts.map +1 -0
  40. package/dist/src/merge-queue/strategies/rebase-strategy.js +62 -0
  41. package/dist/src/merge-queue/strategies/squash-strategy.d.ts +14 -0
  42. package/dist/src/merge-queue/strategies/squash-strategy.d.ts.map +1 -0
  43. package/dist/src/merge-queue/strategies/squash-strategy.js +59 -0
  44. package/dist/src/merge-queue/strategies/strategies.test.d.ts +2 -0
  45. package/dist/src/merge-queue/strategies/strategies.test.d.ts.map +1 -0
  46. package/dist/src/merge-queue/strategies/strategies.test.js +354 -0
  47. package/dist/src/merge-queue/strategies/types.d.ts +62 -0
  48. package/dist/src/merge-queue/strategies/types.d.ts.map +1 -0
  49. package/dist/src/merge-queue/strategies/types.js +7 -0
  50. package/dist/src/orchestrator/parse-work-result.d.ts.map +1 -1
  51. package/dist/src/orchestrator/parse-work-result.js +22 -0
  52. package/dist/src/orchestrator/parse-work-result.test.js +49 -0
  53. package/dist/src/providers/index.d.ts +1 -0
  54. package/dist/src/providers/index.d.ts.map +1 -1
  55. package/dist/src/providers/plugin-types.d.ts +177 -0
  56. package/dist/src/providers/plugin-types.d.ts.map +1 -0
  57. package/dist/src/providers/plugin-types.js +10 -0
  58. package/dist/src/providers/plugin-types.test.d.ts +2 -0
  59. package/dist/src/providers/plugin-types.test.d.ts.map +1 -0
  60. package/dist/src/providers/plugin-types.test.js +810 -0
  61. package/dist/src/registry/index.d.ts +4 -0
  62. package/dist/src/registry/index.d.ts.map +1 -0
  63. package/dist/src/registry/index.js +2 -0
  64. package/dist/src/registry/loader.d.ts +25 -0
  65. package/dist/src/registry/loader.d.ts.map +1 -0
  66. package/dist/src/registry/loader.js +88 -0
  67. package/dist/src/registry/node-type-registry.d.ts +52 -0
  68. package/dist/src/registry/node-type-registry.d.ts.map +1 -0
  69. package/dist/src/registry/node-type-registry.js +130 -0
  70. package/dist/src/registry/types.d.ts +65 -0
  71. package/dist/src/registry/types.d.ts.map +1 -0
  72. package/dist/src/registry/types.js +10 -0
  73. package/dist/src/workflow/expression/ast.d.ts +1 -1
  74. package/dist/src/workflow/expression/ast.d.ts.map +1 -1
  75. package/dist/src/workflow/expression/context.d.ts +4 -0
  76. package/dist/src/workflow/expression/context.d.ts.map +1 -1
  77. package/dist/src/workflow/expression/context.js +5 -1
  78. package/dist/src/workflow/expression/evaluator.d.ts.map +1 -1
  79. package/dist/src/workflow/expression/evaluator.js +24 -1
  80. package/dist/src/workflow/expression/evaluator.test.js +174 -0
  81. package/dist/src/workflow/expression/expression.test.js +140 -1
  82. package/dist/src/workflow/expression/helpers.d.ts +4 -0
  83. package/dist/src/workflow/expression/helpers.d.ts.map +1 -1
  84. package/dist/src/workflow/expression/helpers.js +51 -0
  85. package/dist/src/workflow/expression/index.d.ts +14 -0
  86. package/dist/src/workflow/expression/index.d.ts.map +1 -1
  87. package/dist/src/workflow/expression/index.js +28 -1
  88. package/dist/src/workflow/expression/lexer.d.ts.map +1 -1
  89. package/dist/src/workflow/expression/lexer.js +43 -0
  90. package/dist/src/workflow/expression/parser.js +1 -1
  91. package/dist/src/workflow/index.d.ts +3 -3
  92. package/dist/src/workflow/index.d.ts.map +1 -1
  93. package/dist/src/workflow/index.js +4 -2
  94. package/dist/src/workflow/workflow-loader.d.ts +8 -2
  95. package/dist/src/workflow/workflow-loader.d.ts.map +1 -1
  96. package/dist/src/workflow/workflow-loader.js +21 -2
  97. package/dist/src/workflow/workflow-types.d.ts +781 -12
  98. package/dist/src/workflow/workflow-types.d.ts.map +1 -1
  99. package/dist/src/workflow/workflow-types.js +248 -3
  100. package/dist/src/workflow/workflow-types.test.js +621 -1
  101. package/package.json +3 -2
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Merge Strategy Types
3
+ *
4
+ * Pluggable interface for merge strategies (rebase, merge, squash).
5
+ * Each strategy encapsulates how a PR branch is integrated into the target branch.
6
+ */
7
+ /** Context passed to every merge strategy operation */
8
+ export interface MergeContext {
9
+ /** Path to the bare repository */
10
+ repoPath: string;
11
+ /** Path to the worktree used for merge operations */
12
+ worktreePath: string;
13
+ /** Branch being merged (PR branch) */
14
+ sourceBranch: string;
15
+ /** Branch being merged into (e.g. main) */
16
+ targetBranch: string;
17
+ /** Pull request number */
18
+ prNumber: number;
19
+ /** Git remote name (default 'origin') */
20
+ remote: string;
21
+ }
22
+ /** Result of the prepare step */
23
+ export interface PrepareResult {
24
+ /** Whether preparation succeeded */
25
+ success: boolean;
26
+ /** Error message if preparation failed */
27
+ error?: string;
28
+ /** HEAD SHA after preparation */
29
+ headSha?: string;
30
+ }
31
+ /** Result of the execute (merge) step */
32
+ export interface MergeResult {
33
+ /** Outcome of the merge attempt */
34
+ status: 'success' | 'conflict' | 'error';
35
+ /** SHA of the merge result commit */
36
+ mergedSha?: string;
37
+ /** List of files with conflicts (when status is 'conflict') */
38
+ conflictFiles?: string[];
39
+ /** Human-readable conflict details */
40
+ conflictDetails?: string;
41
+ /** Error message (when status is 'error') */
42
+ error?: string;
43
+ }
44
+ /**
45
+ * Pluggable merge strategy interface.
46
+ *
47
+ * Lifecycle:
48
+ * 1. prepare() — fetch latest refs and check out the working branch
49
+ * 2. execute() — perform the merge/rebase/squash operation
50
+ * 3. finalize() — push the result to the remote
51
+ */
52
+ export interface MergeStrategy {
53
+ /** Strategy identifier */
54
+ readonly name: 'rebase' | 'merge' | 'squash';
55
+ /** Fetch latest refs and check out the working branch */
56
+ prepare(ctx: MergeContext): Promise<PrepareResult>;
57
+ /** Perform the merge operation */
58
+ execute(ctx: MergeContext): Promise<MergeResult>;
59
+ /** Push the result to the remote */
60
+ finalize(ctx: MergeContext): Promise<void>;
61
+ }
62
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/merge-queue/strategies/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAA;CACf;AAED,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,yCAAyC;AACzC,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAA;IACxC,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IAC5C,yDAAyD;IACzD,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAClD,kCAAkC;IAClC,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IAChD,oCAAoC;IACpC,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3C"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Merge Strategy Types
3
+ *
4
+ * Pluggable interface for merge strategies (rebase, merge, squash).
5
+ * Each strategy encapsulates how a PR branch is integrated into the target branch.
6
+ */
7
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"parse-work-result.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/parse-work-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6GjD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,QAAQ,EAAE,aAAa,GACtB,eAAe,CAyCjB"}
1
+ {"version":3,"file":"parse-work-result.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/parse-work-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA6HjD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,QAAQ,EAAE,aAAa,GACtB,eAAe,CAkDjB"}
@@ -81,6 +81,20 @@ const COORDINATION_PASS_PATTERNS = [
81
81
  // "Parent issue marked Finished" — coordinator confirms parent status update
82
82
  /\bParent\s+issue\s+marked\s+Finished/i,
83
83
  ];
84
+ const MERGE_PASS_PATTERNS = [
85
+ /merge.*completed/i,
86
+ /successfully\s+merged/i,
87
+ /fast-forward\s+merge/i,
88
+ /merged\s+to\s+main/i,
89
+ /merge\s+queue.*completed/i,
90
+ ];
91
+ const MERGE_FAIL_PATTERNS = [
92
+ /merge.*failed/i,
93
+ /merge\s+conflict/i,
94
+ /could\s+not\s+merge/i,
95
+ /rebase.*failed/i,
96
+ /test.*failed.*after.*rebase/i,
97
+ ];
84
98
  const COORDINATION_FAIL_PATTERNS = [
85
99
  // "Must Fix Before Merge" — agents use this heading for blocking issues
86
100
  /\bMust\s+Fix\s+Before\s+Merge\b/i,
@@ -144,6 +158,14 @@ export function parseWorkResult(resultMessage, workType) {
144
158
  return 'passed';
145
159
  }
146
160
  }
161
+ if (workType === 'merge') {
162
+ if (MERGE_FAIL_PATTERNS.some((p) => p.test(resultMessage))) {
163
+ return 'failed';
164
+ }
165
+ if (MERGE_PASS_PATTERNS.some((p) => p.test(resultMessage))) {
166
+ return 'passed';
167
+ }
168
+ }
147
169
  // 3. Unknown — safe default
148
170
  return 'unknown';
149
171
  }
@@ -233,6 +233,55 @@ describe('parseWorkResult', () => {
233
233
  expect(parseWorkResult('### 3 Critical Issues (Block Merge)\n1. provision-trial.ts uses removed fields', 'acceptance-coordination')).toBe('failed');
234
234
  });
235
235
  });
236
+ // Merge heuristic pattern tests
237
+ describe('merge heuristic patterns', () => {
238
+ it('detects WORK_RESULT:passed marker for merge work type', () => {
239
+ expect(parseWorkResult('<!-- WORK_RESULT:passed -->', 'merge')).toBe('passed');
240
+ });
241
+ it('detects WORK_RESULT:failed marker for merge work type', () => {
242
+ expect(parseWorkResult('<!-- WORK_RESULT:failed -->', 'merge')).toBe('failed');
243
+ });
244
+ it('detects "successfully merged" as pass', () => {
245
+ expect(parseWorkResult('The PR was successfully merged to main.', 'merge')).toBe('passed');
246
+ });
247
+ it('detects "merge completed" as pass', () => {
248
+ expect(parseWorkResult('Merge completed without issues.', 'merge')).toBe('passed');
249
+ });
250
+ it('detects "fast-forward merge" as pass', () => {
251
+ expect(parseWorkResult('Applied fast-forward merge to the branch.', 'merge')).toBe('passed');
252
+ });
253
+ it('detects "merged to main" as pass', () => {
254
+ expect(parseWorkResult('PR #42 merged to main successfully.', 'merge')).toBe('passed');
255
+ });
256
+ it('detects "merge queue completed" as pass', () => {
257
+ expect(parseWorkResult('Merge queue completed for this PR.', 'merge')).toBe('passed');
258
+ });
259
+ it('detects "merge conflict" as fail', () => {
260
+ expect(parseWorkResult('Encountered a merge conflict in src/index.ts.', 'merge')).toBe('failed');
261
+ });
262
+ it('detects "merge failed" as fail', () => {
263
+ expect(parseWorkResult('The merge failed due to CI check failures.', 'merge')).toBe('failed');
264
+ });
265
+ it('detects "could not merge" as fail', () => {
266
+ expect(parseWorkResult('Could not merge the PR — conflicts detected.', 'merge')).toBe('failed');
267
+ });
268
+ it('detects "rebase failed" as fail', () => {
269
+ expect(parseWorkResult('Rebase failed on commit abc123.', 'merge')).toBe('failed');
270
+ });
271
+ it('detects "test failed after rebase" as fail', () => {
272
+ expect(parseWorkResult('The test suite failed after rebase on main.', 'merge')).toBe('failed');
273
+ });
274
+ it('checks fail patterns before pass patterns', () => {
275
+ expect(parseWorkResult('Merge completed but then merge failed on retry.', 'merge')).toBe('failed');
276
+ });
277
+ it('does not match merge patterns for non-merge work types', () => {
278
+ expect(parseWorkResult('successfully merged', 'development')).toBe('unknown');
279
+ expect(parseWorkResult('merge conflict', 'qa')).toBe('unknown');
280
+ });
281
+ it('returns unknown for ambiguous merge messages', () => {
282
+ expect(parseWorkResult('Working on the merge process.', 'merge')).toBe('unknown');
283
+ });
284
+ });
236
285
  // Unknown result tests
237
286
  describe('unknown results', () => {
238
287
  it('returns unknown for undefined message', () => {
@@ -29,6 +29,7 @@
29
29
  */
30
30
  export type { AgentProviderName, AgentProvider, AgentSpawnConfig, AgentHandle, AgentEvent } from './types.js';
31
31
  export type { AgentInitEvent, AgentSystemEvent, AgentAssistantTextEvent, AgentToolUseEvent, AgentToolResultEvent, AgentToolProgressEvent, AgentResultEvent, AgentErrorEvent, AgentCostData, } from './types.js';
32
+ export type { ActionDefinition, ActionResult, AuthResult, ConditionContext, ConditionDefinition, CredentialDefinition, CredentialField, DynamicOptionField, NormalizedEvent, ProviderExecutionContext, ProviderPlugin, TriggerDefinition, WebhookConfig, WebhookRegistration, } from './plugin-types.js';
32
33
  export { ClaudeProvider, createClaudeProvider } from './claude-provider.js';
33
34
  export { CodexProvider, createCodexProvider } from './codex-provider.js';
34
35
  export { AmpProvider, createAmpProvider } from './amp-provider.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC7G,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,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@@
1
+ /**
2
+ * Provider Plugin Interfaces
3
+ *
4
+ * Defines the core type system for provider plugins — integrations that
5
+ * expose actions, triggers, and conditions (e.g. Slack, GitHub, Jira).
6
+ *
7
+ * This is SEPARATE from AgentProvider (types.ts), which handles agent
8
+ * process management. ProviderPlugin handles integration capabilities.
9
+ */
10
+ import type { JSONSchema7 } from 'json-schema';
11
+ /** A single credential field required by a provider's authentication */
12
+ export interface CredentialField {
13
+ /** Machine-readable field name */
14
+ name: string;
15
+ /** Human-readable label */
16
+ label: string;
17
+ /** Input type hint for credential UIs */
18
+ type: 'string' | 'url' | 'password';
19
+ /** Whether this field contains a secret value */
20
+ secret?: boolean;
21
+ /** Help text describing the field */
22
+ description?: string;
23
+ }
24
+ /** Result of validating provider credentials */
25
+ export interface AuthResult {
26
+ /** Whether authentication succeeded */
27
+ valid: boolean;
28
+ /** Error message when authentication fails */
29
+ error?: string;
30
+ /** Additional metadata returned by the auth check */
31
+ metadata?: Record<string, unknown>;
32
+ }
33
+ /** Describes a field whose options are resolved at runtime */
34
+ export interface DynamicOptionField {
35
+ /** Dot-path to the field within the input schema */
36
+ fieldPath: string;
37
+ /** Other field paths whose values must be resolved first */
38
+ dependsOn?: string[];
39
+ }
40
+ /** Runtime context passed to action and trigger executors */
41
+ export interface ProviderExecutionContext {
42
+ /** Resolved credential values for the provider */
43
+ credentials: Record<string, string>;
44
+ /** Optional environment variables */
45
+ env?: Record<string, string>;
46
+ }
47
+ /** Result returned by an action execution */
48
+ export interface ActionResult {
49
+ /** Whether the action completed successfully */
50
+ success: boolean;
51
+ /** Payload returned by the action on success */
52
+ data?: unknown;
53
+ /** Error message when the action fails */
54
+ error?: string;
55
+ }
56
+ /** A provider event normalized to a common shape */
57
+ export interface NormalizedEvent {
58
+ /** Unique event identifier */
59
+ id: string;
60
+ /** Event type (e.g. 'issue.created', 'message.posted') */
61
+ type: string;
62
+ /** When the event occurred */
63
+ timestamp: Date;
64
+ /** Structured event payload */
65
+ data: Record<string, unknown>;
66
+ /** Original un-normalized event from the provider */
67
+ raw: unknown;
68
+ }
69
+ /** Configuration for registering a webhook with a provider */
70
+ export interface WebhookConfig {
71
+ /** The URL the provider should deliver events to */
72
+ url: string;
73
+ /** Shared secret for verifying webhook payloads */
74
+ secret?: string;
75
+ /** Event types to subscribe to */
76
+ events?: string[];
77
+ }
78
+ /** Handle returned after a webhook is registered */
79
+ export interface WebhookRegistration {
80
+ /** Provider-assigned webhook identifier */
81
+ id: string;
82
+ /** The registered webhook URL */
83
+ url: string;
84
+ /** Provider-specific registration metadata */
85
+ metadata?: Record<string, unknown>;
86
+ }
87
+ /** Context available when evaluating a condition */
88
+ export interface ConditionContext {
89
+ /** The trigger event that initiated the workflow, if any */
90
+ triggerEvent?: NormalizedEvent;
91
+ /** Outputs from previous workflow steps, keyed by step id */
92
+ stepOutputs?: Record<string, unknown>;
93
+ }
94
+ /** Defines how a provider authenticates (OAuth2, API key, bearer token) */
95
+ export interface CredentialDefinition {
96
+ /** Unique credential identifier within the provider */
97
+ id: string;
98
+ /** Authentication strategy */
99
+ authType: 'oauth2' | 'apiKey' | 'bearer';
100
+ /** Fields the user must supply */
101
+ requiredFields: CredentialField[];
102
+ /** Validate the supplied credentials against the provider */
103
+ authenticate(credentials: Record<string, string>): Promise<AuthResult>;
104
+ }
105
+ /** An operation that can be performed against a provider */
106
+ export interface ActionDefinition {
107
+ /** Unique action identifier within the provider */
108
+ id: string;
109
+ /** Human-readable action name */
110
+ displayName: string;
111
+ /** Brief description of what the action does */
112
+ description?: string;
113
+ /** Grouping category for UI organization */
114
+ category?: string;
115
+ /** JSON Schema describing the action's input parameters */
116
+ inputSchema: JSONSchema7;
117
+ /** JSON Schema describing the action's output shape */
118
+ outputSchema: JSONSchema7;
119
+ /** Fields whose options are resolved dynamically at runtime */
120
+ dynamicOptions?: DynamicOptionField[];
121
+ /** Execute the action with the given input and credentials */
122
+ execute(input: Record<string, unknown>, context: ProviderExecutionContext): Promise<ActionResult>;
123
+ }
124
+ /** An event source that can initiate workflows */
125
+ export interface TriggerDefinition {
126
+ /** Unique trigger identifier within the provider */
127
+ id: string;
128
+ /** Human-readable trigger name */
129
+ displayName: string;
130
+ /** Brief description of the trigger */
131
+ description?: string;
132
+ /** The type of event this trigger produces */
133
+ eventType: string;
134
+ /** JSON Schema for filtering which events match */
135
+ filterSchema: JSONSchema7;
136
+ /** Convert a raw provider event into a NormalizedEvent */
137
+ normalizeEvent(rawEvent: unknown): NormalizedEvent;
138
+ /** Register a webhook with the provider to receive events */
139
+ registerWebhook(config: WebhookConfig): Promise<WebhookRegistration>;
140
+ /** Remove a previously registered webhook */
141
+ deregisterWebhook(registration: WebhookRegistration): Promise<void>;
142
+ }
143
+ /** A boolean predicate used for conditional branching in workflows */
144
+ export interface ConditionDefinition {
145
+ /** Unique condition identifier within the provider */
146
+ id: string;
147
+ /** Human-readable condition name */
148
+ displayName: string;
149
+ /** Brief description of the condition */
150
+ description?: string;
151
+ /** JSON Schema describing the evaluation parameters */
152
+ evaluationSchema: JSONSchema7;
153
+ /** Evaluate the condition against the given parameters and context */
154
+ evaluate(params: Record<string, unknown>, context: ConditionContext): Promise<boolean>;
155
+ }
156
+ /** A provider plugin that bundles actions, triggers, conditions, and credentials */
157
+ export interface ProviderPlugin {
158
+ /** Unique provider identifier (e.g. 'slack', 'github', 'jira') */
159
+ id: string;
160
+ /** Human-readable provider name */
161
+ displayName: string;
162
+ /** Brief description of the provider */
163
+ description?: string;
164
+ /** Semantic version of the plugin */
165
+ version: string;
166
+ /** Icon identifier or URL for the provider */
167
+ icon?: string;
168
+ /** Actions this provider exposes */
169
+ actions: ActionDefinition[];
170
+ /** Triggers (event sources) this provider exposes */
171
+ triggers: TriggerDefinition[];
172
+ /** Conditions this provider exposes */
173
+ conditions: ConditionDefinition[];
174
+ /** Credential definitions for authenticating with this provider */
175
+ credentials: CredentialDefinition[];
176
+ }
177
+ //# sourceMappingURL=plugin-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pl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AAgB,EAAE,WAAW,CAAA;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACvF;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAA;IACV,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,qDAAqD;IACrD,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,uCAAuC;IACvC,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC,mEAAmE;IACnE,WAAW,EAAE,oBAAoB,EAAE,CAAA;CACpC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Provider Plugin Interfaces
3
+ *
4
+ * Defines the core type system for provider plugins — integrations that
5
+ * expose actions, triggers, and conditions (e.g. Slack, GitHub, Jira).
6
+ *
7
+ * This is SEPARATE from AgentProvider (types.ts), which handles agent
8
+ * process management. ProviderPlugin handles integration capabilities.
9
+ */
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=plugin-types.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-types.test.d.ts","sourceRoot":"","sources":["../../../src/providers/plugin-types.test.ts"],"names":[],"mappings":""}