@leitwerk-dev/process-sdk 0.2.1 → 0.3.0

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 (41) hide show
  1. package/README.md +12 -0
  2. package/dist/core-capabilities.d.ts +2 -0
  3. package/dist/core-capabilities.d.ts.map +1 -1
  4. package/dist/{extension-api-B4gG5w1K.d.ts → extension-api-3Vr3RE8S.d.ts} +5 -5
  5. package/dist/extension-api.d.ts +5 -5
  6. package/dist/extension-api.d.ts.map +1 -1
  7. package/dist/external-source-poll.d.ts +18 -12
  8. package/dist/external-source-poll.d.ts.map +1 -1
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +45 -38
  12. package/dist/index.js.map +1 -1
  13. package/dist/integration-http.d.ts +4 -4
  14. package/dist/integration-http.d.ts.map +1 -1
  15. package/dist/json-data.d.ts +1 -1
  16. package/dist/json-data.d.ts.map +1 -1
  17. package/dist/repository-feedback.d.ts +32 -26
  18. package/dist/repository-feedback.d.ts.map +1 -1
  19. package/dist/repository-https.d.ts +1 -1
  20. package/dist/repository-https.d.ts.map +1 -1
  21. package/dist/repository-issue-watcher.d.ts +30 -25
  22. package/dist/repository-issue-watcher.d.ts.map +1 -1
  23. package/dist/repository-source-config.d.ts +29 -44
  24. package/dist/repository-source-config.d.ts.map +1 -1
  25. package/dist/subprocess-env.d.ts +1 -1
  26. package/dist/subprocess-env.d.ts.map +1 -1
  27. package/dist/tool-arguments.d.ts +3 -3
  28. package/dist/tool-arguments.d.ts.map +1 -1
  29. package/package.json +6 -6
  30. package/src/core-capabilities.ts +2 -0
  31. package/src/extension-api.ts +5 -5
  32. package/src/external-source-poll.ts +65 -11
  33. package/src/index.ts +9 -1
  34. package/src/integration-http.ts +3 -3
  35. package/src/json-data.ts +1 -1
  36. package/src/repository-feedback.ts +48 -20
  37. package/src/repository-https.ts +1 -1
  38. package/src/repository-issue-watcher.ts +48 -21
  39. package/src/repository-source-config.ts +66 -23
  40. package/src/subprocess-env.ts +1 -1
  41. package/src/tool-arguments.ts +3 -3
@@ -1,10 +1,10 @@
1
- /** An HTTP failure without provider response bodies or credentials. @internal */
1
+ /** An HTTP failure without provider response bodies or credentials. @public */
2
2
  export declare class IntegrationHttpError extends Error {
3
- /** @internal */
3
+ /** @public */
4
4
  readonly status: number;
5
- /** @internal */
5
+ /** @public */
6
6
  constructor(
7
- /** @internal */
7
+ /** @public */
8
8
  status: number, message: string);
9
9
  }
10
10
  /** Shared transport; extensions own endpoint paths, credentials, and response types. @public */
@@ -1 +1 @@
1
- {"version":3,"file":"integration-http.d.ts","sourceRoot":"","sources":["../src/integration-http.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,qBAAa,oBAAqB,SAAQ,KAAK;IAG7C,gBAAgB;IAChB,QAAQ,CAAC,MAAM,EAAE,MAAM;IAHxB,gBAAgB;;IAEf,gBAAgB;IACP,MAAM,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM;CAIhB;AAED,gGAAgG;AAChG,qBAAa,qBAAqB;IAGhC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAL5B,gBAAgB;gBAEE,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU;QAC1B,gBAAgB;;QAEhB,gBAAgB;;KAEhB;IAGF,gBAAgB;cACA,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiBjF,gBAAgB;cACA,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;IAK5E,gBAAgB;IAChB,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW;IAIxF,gBAAgB;cACA,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;CAY1E"}
1
+ {"version":3,"file":"integration-http.d.ts","sourceRoot":"","sources":["../src/integration-http.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,qBAAa,oBAAqB,SAAQ,KAAK;IAG7C,cAAc;IACd,QAAQ,CAAC,MAAM,EAAE,MAAM;IAHxB,cAAc;;IAEb,cAAc;IACL,MAAM,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM;CAIhB;AAED,gGAAgG;AAChG,qBAAa,qBAAqB;IAGhC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAL5B,gBAAgB;gBAEE,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU;QAC1B,gBAAgB;;QAEhB,gBAAgB;;KAEhB;IAGF,gBAAgB;cACA,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiBjF,gBAAgB;cACA,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;IAK5E,gBAAgB;IAChB,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW;IAIxF,gBAAgB;cACA,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;CAY1E"}
@@ -1,3 +1,3 @@
1
- /** Validate and detach JSON data without silently dropping unsupported values. @internal */
1
+ /** Validate and detach JSON data without silently dropping unsupported values. @public */
2
2
  export declare function parseJsonData(value: unknown, message?: string): unknown;
3
3
  //# sourceMappingURL=json-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"json-data.d.ts","sourceRoot":"","sources":["../src/json-data.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,wBAAgB,aAAa,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,SAAoC,GACzC,OAAO,CAoBT"}
1
+ {"version":3,"file":"json-data.d.ts","sourceRoot":"","sources":["../src/json-data.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,wBAAgB,aAAa,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,SAAoC,GACzC,OAAO,CAoBT"}
@@ -2,46 +2,52 @@
2
2
  export interface RepositoryFeedbackItem {
3
3
  /** @public */
4
4
  kind: "conversation" | "review" | "inline";
5
- /** @internal */
5
+ /** @public */
6
6
  id: number;
7
7
  /** @public */
8
8
  body: string;
9
- /** @internal */
9
+ /** @public */
10
10
  createdAt: string;
11
11
  /** @public */
12
12
  author: string;
13
- /** @internal */
13
+ /** @public */
14
14
  path?: string;
15
- /** @internal */
15
+ /** @public */
16
16
  line?: number | null;
17
17
  }
18
- /** Batch already-authorized, unseen feedback after its quiet period. @internal */
19
- export declare function repositoryFeedbackBatch(unseen: readonly RepositoryFeedbackItem[], config: Record<`${RepositoryFeedbackItem["kind"]}Cursor`, number> & {
20
- /** @internal */
18
+ /** Batch already-authorized, unseen feedback after its quiet period. @public */
19
+ export declare function repositoryFeedbackBatch(unseen: readonly RepositoryFeedbackItem[], config: RepositoryFeedbackBatchConfig, now: number): RepositoryFeedbackBatch | null;
20
+ /** Normalize common forge feedback fields; reject empty bodies and missing identities. @public */
21
+ export declare function normalizeRepositoryFeedback(kind: RepositoryFeedbackItem["kind"], item: Record<string, unknown>): RepositoryFeedbackItem | null;
22
+ /** @public */
23
+ export interface RepositoryFeedbackCursors {
24
+ /** @public */
25
+ conversationCursor: number;
26
+ /** @public */
27
+ reviewCursor: number;
28
+ /** @public */
29
+ inlineCursor: number;
30
+ }
31
+ /** @public */
32
+ export interface RepositoryFeedbackBatchConfig extends RepositoryFeedbackCursors {
33
+ /** @public */
21
34
  quietPeriodMs: number;
22
- }, now: number): {
23
- /** @internal */
35
+ }
36
+ /** @public */
37
+ export interface RepositoryFeedbackBatch {
38
+ /** @public */
24
39
  event: {
25
- /** @internal */
40
+ /** @public */
26
41
  feedbackIds: {
27
- /** @internal */
28
- kind: "review" | "conversation" | "inline";
29
- /** @internal */
42
+ /** @public */
43
+ kind: RepositoryFeedbackItem["kind"];
44
+ /** @public */
30
45
  id: number;
31
46
  }[];
32
- /** @internal */
33
- cursors: {
34
- /** @internal */
35
- conversationCursor: number;
36
- /** @internal */
37
- reviewCursor: number;
38
- /** @internal */
39
- inlineCursor: number;
40
- };
47
+ /** @public */
48
+ cursors: RepositoryFeedbackCursors;
41
49
  };
42
- /** @internal */
50
+ /** @public */
43
51
  mergeKey: string;
44
- } | null;
45
- /** Normalize common forge feedback fields; reject empty bodies and missing identities. @internal */
46
- export declare function normalizeRepositoryFeedback(kind: RepositoryFeedbackItem["kind"], item: Record<string, unknown>): RepositoryFeedbackItem | null;
52
+ }
47
53
  //# sourceMappingURL=repository-feedback.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository-feedback.d.ts","sourceRoot":"","sources":["../src/repository-feedback.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,WAAW,sBAAsB;IACtC,cAAc;IACd,IAAI,EAAE,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,kFAAkF;AAClF,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,SAAS,sBAAsB,EAAE,EACzC,MAAM,EAAE,MAAM,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG;IACnE,gBAAgB;IAChB,aAAa,EAAE,MAAM,CAAC;CACtB,EACD,GAAG,EAAE,MAAM;IAkBV,gBAAgB;;QAEf,gBAAgB;;YAEf,gBAAgB;;YAEhB,gBAAgB;;;QAGjB,gBAAgB;;YArBjB,gBAAgB;;YAEhB,gBAAgB;;YAEhB,gBAAgB;;;;IAoBhB,gBAAgB;;SAGjB;AAED,oGAAoG;AACpG,wBAAgB,2BAA2B,CAC1C,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,EACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,sBAAsB,GAAG,IAAI,CAkB/B"}
1
+ {"version":3,"file":"repository-feedback.d.ts","sourceRoot":"","sources":["../src/repository-feedback.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,WAAW,sBAAsB;IACtC,cAAc;IACd,IAAI,EAAE,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,cAAc;IACd,EAAE,EAAE,MAAM,CAAC;IACX,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,SAAS,sBAAsB,EAAE,EACzC,MAAM,EAAE,6BAA6B,EACrC,GAAG,EAAE,MAAM,GACT,uBAAuB,GAAG,IAAI,CAgChC;AAED,kGAAkG;AAClG,wBAAgB,2BAA2B,CAC1C,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,EACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,sBAAsB,GAAG,IAAI,CAkB/B;AACD,cAAc;AACd,MAAM,WAAW,yBAAyB;IACzC,cAAc;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc;IACd,YAAY,EAAE,MAAM,CAAC;CACrB;AACD,cAAc;AACd,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;IAC/E,cAAc;IACd,aAAa,EAAE,MAAM,CAAC;CACtB;AACD,cAAc;AACd,MAAM,WAAW,uBAAuB;IACvC,cAAc;IACd,KAAK,EAAE;QACN,cAAc;QACd,WAAW,EAAE;YACZ,cAAc;YACd,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;YACrC,cAAc;YACd,EAAE,EAAE,MAAM,CAAC;SACX,EAAE,CAAC;QACJ,cAAc;QACd,OAAO,EAAE,yBAAyB,CAAC;KACnC,CAAC;IACF,cAAc;IACd,QAAQ,EAAE,MAAM,CAAC;CACjB"}
@@ -1,3 +1,3 @@
1
- /** Canonical, credential-free HTTPS repository URL. Reject ambiguous Git credential paths. @internal */
1
+ /** Canonical, credential-free HTTPS repository URL. Reject ambiguous Git credential paths. @public */
2
2
  export declare function repositoryHttpsUrl(value: string): URL;
3
3
  //# sourceMappingURL=repository-https.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository-https.d.ts","sourceRoot":"","sources":["../src/repository-https.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAoBrD"}
1
+ {"version":3,"file":"repository-https.d.ts","sourceRoot":"","sources":["../src/repository-https.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAoBrD"}
@@ -1,51 +1,56 @@
1
+ import type { LaunchModelConfigInput } from "@leitwerk-dev/domain";
1
2
  /** @public */
2
3
  export interface RepositoryIssueWatcherConfig {
3
- /** @internal */
4
+ /** @public */
4
5
  profile: string;
5
- /** @internal */
6
+ /** @public */
6
7
  pollInterval: string;
7
- /** @internal */
8
+ /** @public */
8
9
  repositories: {
9
- /** @internal */
10
+ /** @public */
10
11
  include: readonly string[];
11
- /** @internal */
12
+ /** @public */
12
13
  exclude: readonly string[];
13
14
  };
14
- /** @internal */
15
+ /** @public */
15
16
  labels: {
16
- /** @internal */
17
+ /** @public */
17
18
  trigger: string;
18
- /** @internal */
19
+ /** @public */
19
20
  done: string;
20
21
  };
21
22
  }
22
- /** @internal */
23
+ /** @public */
23
24
  export declare function matchesRepository(config: Pick<RepositoryIssueWatcherConfig, "repositories">, repository: {
24
- /** @internal */
25
+ /** @public */
25
26
  full_name: string;
26
27
  }): boolean;
27
- /** Parse shared issue watcher fields; extensions choose the legacy type and label policy. @internal */
28
- export declare function parseRepositoryIssueWatcherConfig(raw: unknown, legacyType: string, distinctLabels?: boolean): {
29
- /** @internal */
28
+ /** Parse shared issue watcher fields; extensions choose the legacy type and label policy. @public */
29
+ export declare function parseRepositoryIssueWatcherConfig(raw: unknown, legacyType: string, distinctLabels?: boolean): ParsedRepositoryIssueWatcherConfig;
30
+ /** @public */
31
+ export declare function presentRepositoryIssueWatcherConfig(config: RepositoryIssueWatcherConfig): RepositoryIssueWatcherPresentation;
32
+ /** @public */
33
+ export interface ParsedRepositoryIssueWatcherConfig {
34
+ /** @public */
30
35
  config: RepositoryIssueWatcherConfig;
31
- /** @internal */
36
+ /** @public */
32
37
  enabled: boolean;
33
- /** @internal */
34
- launchModelConfig: import("@leitwerk-dev/domain").LaunchModelConfigInput & {
35
- /** @internal */
38
+ /** @public */
39
+ launchModelConfig: LaunchModelConfigInput & {
40
+ /** @public */
36
41
  skillIds: string[];
37
42
  };
38
- };
39
- /** @internal */
40
- export declare function presentRepositoryIssueWatcherConfig(config: RepositoryIssueWatcherConfig): {
41
- /** @internal */
43
+ }
44
+ /** @public */
45
+ export interface RepositoryIssueWatcherPresentation {
46
+ /** @public */
42
47
  targetSummary: string;
43
- /** @internal */
48
+ /** @public */
44
49
  details: {
45
- /** @internal */
50
+ /** @public */
46
51
  label: string;
47
- /** @internal */
52
+ /** @public */
48
53
  value: string;
49
54
  }[];
50
- };
55
+ }
51
56
  //# sourceMappingURL=repository-issue-watcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository-issue-watcher.d.ts","sourceRoot":"","sources":["../src/repository-issue-watcher.ts"],"names":[],"mappings":"AAIA,cAAc;AACd,MAAM,WAAW,4BAA4B;IAC5C,gBAAgB;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,YAAY,EAAE;QACb,gBAAgB;QAChB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;QAC3B,gBAAgB;QAChB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;KAC3B,CAAC;IACF,gBAAgB;IAChB,MAAM,EAAE;QACP,gBAAgB;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,gBAAgB;QAChB,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,gBAAgB;AAChB,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,IAAI,CAAC,4BAA4B,EAAE,cAAc,CAAC,EAC1D,UAAU,EAAE;IACX,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB,GACC,OAAO,CAMT;AAsBD,uGAAuG;AACvG,wBAAgB,iCAAiC,CAChD,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,MAAM,EAClB,cAAc,UAAQ;IA2BrB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;;;;EAGjB;AAED,gBAAgB;AAChB,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,4BAA4B;IAEtF,gBAAgB;;IAEhB,gBAAgB;;QAGd,gBAAgB;;QAEhB,gBAAgB;;;EAUnB"}
1
+ {"version":3,"file":"repository-issue-watcher.d.ts","sourceRoot":"","sources":["../src/repository-issue-watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAKnE,cAAc;AACd,MAAM,WAAW,4BAA4B;IAC5C,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc;IACd,YAAY,EAAE;QACb,cAAc;QACd,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;QAC3B,cAAc;QACd,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;KAC3B,CAAC;IACF,cAAc;IACd,MAAM,EAAE;QACP,cAAc;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc;QACd,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,cAAc;AACd,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,IAAI,CAAC,4BAA4B,EAAE,cAAc,CAAC,EAC1D,UAAU,EAAE;IACX,cAAc;IACd,SAAS,EAAE,MAAM,CAAC;CAClB,GACC,OAAO,CAMT;AAsBD,qGAAqG;AACrG,wBAAgB,iCAAiC,CAChD,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,MAAM,EAClB,cAAc,UAAQ,GACpB,kCAAkC,CAiCpC;AAED,cAAc;AACd,wBAAgB,mCAAmC,CAClD,MAAM,EAAE,4BAA4B,GAClC,kCAAkC,CAmBpC;AACD,cAAc;AACd,MAAM,WAAW,kCAAkC;IAClD,cAAc;IACd,MAAM,EAAE,4BAA4B,CAAC;IACrC,cAAc;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc;IACd,iBAAiB,EAAE,sBAAsB,GAAG;QAC3C,cAAc;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;CACF;AACD,cAAc;AACd,MAAM,WAAW,kCAAkC;IAClD,cAAc;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc;IACd,OAAO,EAAE;QACR,cAAc;QACd,KAAK,EAAE,MAAM,CAAC;QACd,cAAc;QACd,KAAK,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;CACJ"}
@@ -1,58 +1,43 @@
1
- /** Parse common forge source fields, preserving polling defaults and permissive string handling. @internal */
2
- export declare function parseRepositoryPullRequestConfig(value: unknown): {
3
- /** @internal */
1
+ import type { RepositoryFeedbackBatchConfig } from "./repository-feedback.js";
2
+ /** Parse common forge source fields, preserving polling defaults and permissive string handling. @public */
3
+ export declare function parseRepositoryPullRequestConfig(value: unknown): RepositoryPullRequestSourceConfig | null;
4
+ /** @public */
5
+ export declare function parseRepositoryFeedbackConfig(value: unknown): RepositoryFeedbackSourceConfig | null;
6
+ /** @public */
7
+ export declare function parseRepositoryIssueCancelledConfig(value: unknown): RepositoryIssueCancelledSourceConfig | null;
8
+ /** @public */
9
+ export interface RepositoryPullRequestSourceConfig {
10
+ /** @public */
4
11
  profile: string;
5
- /** @internal */
12
+ /** @public */
6
13
  owner: string;
7
- /** @internal */
14
+ /** @public */
8
15
  repo: string;
9
- /** @internal */
16
+ /** @public */
10
17
  prNumber: number;
11
- /** @internal */
18
+ /** @public */
12
19
  pollInterval: string;
13
- /** @internal */
20
+ /** @public */
14
21
  terminalOutcome: "merged" | "closed" | undefined;
15
- /** @internal */
22
+ /** @public */
16
23
  disabled: boolean;
17
- } | null;
18
- /** @internal */
19
- export declare function parseRepositoryFeedbackConfig(value: unknown): {
20
- /** @internal */
21
- conversationCursor: number;
22
- /** @internal */
23
- reviewCursor: number;
24
- /** @internal */
25
- inlineCursor: number;
26
- /** @internal */
27
- quietPeriodMs: number;
28
- /** @internal */
24
+ }
25
+ /** @public */
26
+ export interface RepositoryFeedbackSourceConfig extends RepositoryPullRequestSourceConfig, RepositoryFeedbackBatchConfig {
27
+ }
28
+ /** @public */
29
+ export interface RepositoryIssueCancelledSourceConfig {
30
+ /** @public */
29
31
  profile: string;
30
- /** @internal */
32
+ /** @public */
31
33
  owner: string;
32
- /** @internal */
34
+ /** @public */
33
35
  repo: string;
34
- /** @internal */
35
- prNumber: number;
36
- /** @internal */
37
- pollInterval: string;
38
- /** @internal */
39
- terminalOutcome: "merged" | "closed" | undefined;
40
- /** @internal */
41
- disabled: boolean;
42
- } | null;
43
- /** @internal */
44
- export declare function parseRepositoryIssueCancelledConfig(value: unknown): {
45
- /** @internal */
46
- profile: string;
47
- /** @internal */
48
- owner: string;
49
- /** @internal */
50
- repo: string;
51
- /** @internal */
36
+ /** @public */
52
37
  issueNumber: number;
53
- /** @internal */
38
+ /** @public */
54
39
  triggerLabel: string;
55
- /** @internal */
40
+ /** @public */
56
41
  pollInterval: string;
57
- } | null;
42
+ }
58
43
  //# sourceMappingURL=repository-source-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repository-source-config.d.ts","sourceRoot":"","sources":["../src/repository-source-config.ts"],"names":[],"mappings":"AAEA,8GAA8G;AAC9G,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO;IAc7D,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;SAGjB;AAED,gBAAgB;AAChB,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO;IAM1D,gBAAgB;;IAGhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IA/BhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;SAsBjB;AAED,gBAAgB;AAChB,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,OAAO;IAWhE,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,gBAAgB;;SAGjB"}
1
+ {"version":3,"file":"repository-source-config.d.ts","sourceRoot":"","sources":["../src/repository-source-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E,4GAA4G;AAC5G,wBAAgB,gCAAgC,CAC/C,KAAK,EAAE,OAAO,GACZ,iCAAiC,GAAG,IAAI,CA6B1C;AAED,cAAc;AACd,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,OAAO,GACZ,8BAA8B,GAAG,IAAI,CAgBvC;AAED,cAAc;AACd,wBAAgB,mCAAmC,CAClD,KAAK,EAAE,OAAO,GACZ,oCAAoC,GAAG,IAAI,CAwB7C;AACD,cAAc;AACd,MAAM,WAAW,iCAAiC;IACjD,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc;IACd,eAAe,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACjD,cAAc;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB;AACD,cAAc;AACd,MAAM,WAAW,8BAChB,SAAQ,iCAAiC,EACxC,6BAA6B;CAAG;AAClC,cAAc;AACd,MAAM,WAAW,oCAAoC;IACpD,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc;IACd,YAAY,EAAE,MAAM,CAAC;CACrB"}
@@ -11,6 +11,6 @@ export declare const WORKER_SUBPROCESS_SENSITIVE_ENV_KEYS: readonly ["LEITWERK_W
11
11
  * process itself. Repository scripts, git hooks, package managers, and other
12
12
  * tool subprocesses must not receive them.
13
13
  */
14
- /** @internal */
14
+ /** @public */
15
15
  export declare function sanitizeWorkerSubprocessEnv(baseEnv?: SubprocessEnvInput, overrides?: SubprocessEnvInput): NodeJS.ProcessEnv;
16
16
  //# sourceMappingURL=subprocess-env.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subprocess-env.d.ts","sourceRoot":"","sources":["../src/subprocess-env.ts"],"names":[],"mappings":"AAMA,cAAc;AACd,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpE,eAAO,MAAM,sCAAsC,0CAA0C,CAAC;AAC9F,eAAO,MAAM,wCAAwC,4CAA4C,CAAC;AAElG,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,2GAIvC,CAAC;AAYX;;;;;;GAMG;AACH,gBAAgB;AAChB,wBAAgB,2BAA2B,CAC1C,OAAO,GAAE,kBAAgC,EACzC,SAAS,GAAE,kBAAuB,GAChC,MAAM,CAAC,UAAU,CAgBnB"}
1
+ {"version":3,"file":"subprocess-env.d.ts","sourceRoot":"","sources":["../src/subprocess-env.ts"],"names":[],"mappings":"AAMA,cAAc;AACd,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpE,eAAO,MAAM,sCAAsC,0CAA0C,CAAC;AAC9F,eAAO,MAAM,wCAAwC,4CAA4C,CAAC;AAElG,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,2GAIvC,CAAC;AAYX;;;;;;GAMG;AACH,cAAc;AACd,wBAAgB,2BAA2B,CAC1C,OAAO,GAAE,kBAAgC,EACzC,SAAS,GAAE,kBAAuB,GAChC,MAAM,CAAC,UAAU,CAgBnB"}
@@ -1,9 +1,9 @@
1
1
  /** Object parameters for a tool bound to a current process project. @public */
2
2
  export declare function projectParameters(properties?: Record<string, unknown>, required?: readonly string[]): Record<string, unknown>;
3
- /** @internal */
3
+ /** @public */
4
4
  export declare function objectArg(value: unknown, message?: string): Record<string, unknown>;
5
- /** Read required integration-tool arguments at the runtime boundary. @internal */
5
+ /** Read required integration-tool arguments at the runtime boundary. @public */
6
6
  export declare function stringArg(args: Record<string, unknown>, name: string): string;
7
- /** @internal */
7
+ /** @public */
8
8
  export declare function numberArg(args: Record<string, unknown>, name: string): number;
9
9
  //# sourceMappingURL=tool-arguments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-arguments.d.ts","sourceRoot":"","sources":["../src/tool-arguments.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAChC,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACxC,QAAQ,GAAE,SAAS,MAAM,EAA4B,GACnD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AAED,gBAAgB;AAChB,wBAAgB,SAAS,CACxB,KAAK,EAAE,OAAO,EACd,OAAO,SAAqC,GAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzB;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7E;AAED,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7E"}
1
+ {"version":3,"file":"tool-arguments.d.ts","sourceRoot":"","sources":["../src/tool-arguments.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAChC,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACxC,QAAQ,GAAE,SAAS,MAAM,EAA4B,GACnD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AAED,cAAc;AACd,wBAAgB,SAAS,CACxB,KAAK,EAAE,OAAO,EACd,OAAO,SAAqC,GAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzB;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7E;AAED,cAAc;AACd,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leitwerk-dev/process-sdk",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/leitwerk-dev/leitwerk.git",
@@ -43,14 +43,14 @@
43
43
  "build": "tsup --silent"
44
44
  },
45
45
  "dependencies": {
46
- "@leitwerk-dev/domain": "0.2.1",
47
- "@leitwerk-dev/protocol": "0.2.1",
48
- "@leitwerk-dev/worker-protocol": "0.2.1",
49
- "@leitwerk-dev/watcher-utils": "0.2.1",
46
+ "@leitwerk-dev/domain": "0.3.0",
47
+ "@leitwerk-dev/protocol": "0.3.0",
48
+ "@leitwerk-dev/worker-protocol": "0.3.0",
49
+ "@leitwerk-dev/watcher-utils": "0.3.0",
50
50
  "escape-html": "^1.0.3",
51
51
  "mustache": "^4.2.0",
52
52
  "valibot": "^1.3.1",
53
- "@leitwerk-dev/external-writes": "0.2.1"
53
+ "@leitwerk-dev/external-writes": "0.3.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/escape-html": "^1.0.4",
@@ -75,6 +75,8 @@ export interface ProcessRepoLike {
75
75
  input: {
76
76
  /** @public */
77
77
  selectedTurnId?: TurnId | null;
78
+ /** Encoded params rewritten by a startup compatibility migration. @public */
79
+ paramsJson?: string | null;
78
80
  /** @public */
79
81
  currentExecution?: ProcessInstance["currentExecution"];
80
82
  /** @public */
@@ -948,13 +948,13 @@ export interface CatalogExtensionAPI {
948
948
  /** @public */
949
949
  export type ExtensionLifecycleHook = () => void | Promise<void>;
950
950
 
951
- /** @internal */
951
+ /** @public */
952
952
  export interface ServerExtensionLogger {
953
- /** @internal */
953
+ /** @public */
954
954
  info?(payload: Record<string, unknown>, message?: string): void;
955
- /** @internal */
955
+ /** @public */
956
956
  warn?(payload: Record<string, unknown>, message?: string): void;
957
- /** @internal */
957
+ /** @public */
958
958
  error?(payload: Record<string, unknown>, message?: string): void;
959
959
  }
960
960
 
@@ -1078,7 +1078,7 @@ export interface IntegrationToolDefinition<TArgs = Record<string, unknown>> {
1078
1078
  export interface ServerExtensionAPI {
1079
1079
  /** @internal */
1080
1080
  readonly events: EventBus<ServerExtensionEventMap>;
1081
- /** @internal */
1081
+ /** @public */
1082
1082
  readonly logger?: ServerExtensionLogger;
1083
1083
  /** @public */
1084
1084
  provide<T>(token: CapabilityToken<T>, value: T): void;
@@ -4,25 +4,33 @@ import type {
4
4
  ExternalSourceServiceLike,
5
5
  } from "./core-capabilities.js";
6
6
 
7
- /** @internal */
8
- type Arming = Pick<ExternalSourceArmingLike, "id" | "instanceId" | "generation">;
7
+ /** @public */
8
+ type Arming = Pick<ExternalSourceArmingLike, "id" | "instanceId" | "generation" | "resolved">;
9
9
 
10
- /** Report one poll's effects without choosing events, scheduling, or subscription policy. @internal */
10
+ /** Report one poll's effects without choosing events, scheduling, or subscription policy. @public */
11
11
  export function createExternalSourcePollReporter(
12
12
  sources: ExternalSourceServiceLike,
13
13
  result: {
14
- /** @internal */
14
+ /** @public */
15
15
  created: string[];
16
- /** @internal */
16
+ /** @public */
17
17
  errors: string[];
18
18
  },
19
19
  options: {
20
- /** @internal */
20
+ /** @public */
21
21
  forwardGeneration?: boolean;
22
+ /** Live source kinds checked before fire and observe. @public */
23
+ currentKinds?: readonly string[];
22
24
  } = {},
23
- ) {
25
+ ): ExternalSourcePollReporter {
26
+ const isCurrent = (kind: string, armed: Arming) =>
27
+ sources.listArmed(kind).some((current) => sameSubscription(armed, current));
28
+ const current = (armed: Arming) =>
29
+ options.currentKinds === undefined ||
30
+ options.currentKinds.some((kind) => isCurrent(kind, armed));
24
31
  return {
25
- /** @internal */
32
+ isCurrent,
33
+ /** @public */
26
34
  async poll(kind: string, read: (armed: ExternalSourceArmingLike) => Promise<void>) {
27
35
  for (const armed of sources.listArmed(kind)) {
28
36
  try {
@@ -34,8 +42,9 @@ export function createExternalSourcePollReporter(
34
42
  }
35
43
  }
36
44
  },
37
- /** @internal */
45
+ /** @public */
38
46
  async fire(armed: Arming, event: Record<string, unknown>, mergeKey: string): Promise<boolean> {
47
+ if (!current(armed)) return false;
39
48
  const fired = await sources.fire({
40
49
  instanceId: armed.instanceId,
41
50
  armingId: armed.id,
@@ -47,9 +56,9 @@ export function createExternalSourcePollReporter(
47
56
  else result.errors.push(`${armed.id}:fire_failed`);
48
57
  return fired.ok;
49
58
  },
50
- /** @internal */
59
+ /** @public */
51
60
  observe(armed: Arming, input: Pick<ExternalObservationInput, "observation" | "refreshError">) {
52
- if (sources.observe && armed.generation)
61
+ if (current(armed) && sources.observe && armed.generation)
53
62
  return sources.observe({
54
63
  instanceId: armed.instanceId,
55
64
  armingId: armed.id,
@@ -59,3 +68,48 @@ export function createExternalSourcePollReporter(
59
68
  },
60
69
  };
61
70
  }
71
+
72
+ /** Effects of one poll, with caller-selected scheduling and event policy. @public */
73
+ export interface ExternalSourcePollReporter {
74
+ /** @public */
75
+ poll(kind: string, read: (armed: ExternalSourceArmingLike) => Promise<void>): Promise<void>;
76
+ /** @public */
77
+ fire(armed: Arming, event: Record<string, unknown>, mergeKey: string): Promise<boolean>;
78
+ /** @public */
79
+ observe(
80
+ armed: Arming,
81
+ input: Pick<ExternalObservationInput, "observation" | "refreshError">,
82
+ ): ReturnType<NonNullable<ExternalSourceServiceLike["observe"]>> | undefined;
83
+ /** Compare the captured identity, generation and resolved value with a live subscription. @public */
84
+ isCurrent(kind: string, armed: Arming): boolean;
85
+ }
86
+ /** A captured generation and resolved identity must still be armed after provider I/O. @internal */
87
+ function sameSubscription(
88
+ captured: {
89
+ /** @internal */
90
+ id: string;
91
+ /** @internal */
92
+ instanceId: string;
93
+ /** @internal */
94
+ generation?: string;
95
+ /** @internal */
96
+ resolved: unknown;
97
+ },
98
+ current: {
99
+ /** @internal */
100
+ id: string;
101
+ /** @internal */
102
+ instanceId: string;
103
+ /** @internal */
104
+ generation?: string;
105
+ /** @internal */
106
+ resolved: unknown;
107
+ },
108
+ ): boolean {
109
+ return (
110
+ current.id === captured.id &&
111
+ current.instanceId === captured.instanceId &&
112
+ current.generation === captured.generation &&
113
+ JSON.stringify(current.resolved) === JSON.stringify(captured.resolved)
114
+ );
115
+ }
package/src/index.ts CHANGED
@@ -134,7 +134,10 @@ export type {
134
134
  } from "./extension-api.js";
135
135
  export { findUiLauncherById, SafeLaunchPreparationError } from "./extension-api.js";
136
136
  export { defineExternalActionSource } from "./external-action-source.js";
137
- export { createExternalSourcePollReporter } from "./external-source-poll.js";
137
+ export {
138
+ createExternalSourcePollReporter,
139
+ type ExternalSourcePollReporter,
140
+ } from "./external-source-poll.js";
138
141
  export {
139
142
  AutomaticOutcomeBuilder,
140
143
  createFlowPromptContext,
@@ -249,6 +252,11 @@ export {
249
252
  type RepositoryIssueWatcherConfig,
250
253
  } from "./repository-issue-watcher.js";
251
254
  export { existingObject, matchesPatch } from "./repository-reconciliation.js";
255
+ export type {
256
+ RepositoryFeedbackSourceConfig,
257
+ RepositoryIssueCancelledSourceConfig,
258
+ RepositoryPullRequestSourceConfig,
259
+ } from "./repository-source-config.js";
252
260
  export {
253
261
  parseRepositoryFeedbackConfig,
254
262
  parseRepositoryIssueCancelledConfig,
@@ -1,8 +1,8 @@
1
- /** An HTTP failure without provider response bodies or credentials. @internal */
1
+ /** An HTTP failure without provider response bodies or credentials. @public */
2
2
  export class IntegrationHttpError extends Error {
3
- /** @internal */
3
+ /** @public */
4
4
  constructor(
5
- /** @internal */
5
+ /** @public */
6
6
  readonly status: number,
7
7
  message: string,
8
8
  ) {
package/src/json-data.ts CHANGED
@@ -1,4 +1,4 @@
1
- /** Validate and detach JSON data without silently dropping unsupported values. @internal */
1
+ /** Validate and detach JSON data without silently dropping unsupported values. @public */
2
2
  export function parseJsonData(
3
3
  value: unknown,
4
4
  message = "Value must be JSON-serializable",