@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.
- package/README.md +12 -0
- package/dist/core-capabilities.d.ts +2 -0
- package/dist/core-capabilities.d.ts.map +1 -1
- package/dist/{extension-api-B4gG5w1K.d.ts → extension-api-3Vr3RE8S.d.ts} +5 -5
- package/dist/extension-api.d.ts +5 -5
- package/dist/extension-api.d.ts.map +1 -1
- package/dist/external-source-poll.d.ts +18 -12
- package/dist/external-source-poll.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -38
- package/dist/index.js.map +1 -1
- package/dist/integration-http.d.ts +4 -4
- package/dist/integration-http.d.ts.map +1 -1
- package/dist/json-data.d.ts +1 -1
- package/dist/json-data.d.ts.map +1 -1
- package/dist/repository-feedback.d.ts +32 -26
- package/dist/repository-feedback.d.ts.map +1 -1
- package/dist/repository-https.d.ts +1 -1
- package/dist/repository-https.d.ts.map +1 -1
- package/dist/repository-issue-watcher.d.ts +30 -25
- package/dist/repository-issue-watcher.d.ts.map +1 -1
- package/dist/repository-source-config.d.ts +29 -44
- package/dist/repository-source-config.d.ts.map +1 -1
- package/dist/subprocess-env.d.ts +1 -1
- package/dist/subprocess-env.d.ts.map +1 -1
- package/dist/tool-arguments.d.ts +3 -3
- package/dist/tool-arguments.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/core-capabilities.ts +2 -0
- package/src/extension-api.ts +5 -5
- package/src/external-source-poll.ts +65 -11
- package/src/index.ts +9 -1
- package/src/integration-http.ts +3 -3
- package/src/json-data.ts +1 -1
- package/src/repository-feedback.ts +48 -20
- package/src/repository-https.ts +1 -1
- package/src/repository-issue-watcher.ts +48 -21
- package/src/repository-source-config.ts +66 -23
- package/src/subprocess-env.ts +1 -1
- package/src/tool-arguments.ts +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/** An HTTP failure without provider response bodies or credentials. @
|
|
1
|
+
/** An HTTP failure without provider response bodies or credentials. @public */
|
|
2
2
|
export declare class IntegrationHttpError extends Error {
|
|
3
|
-
/** @
|
|
3
|
+
/** @public */
|
|
4
4
|
readonly status: number;
|
|
5
|
-
/** @
|
|
5
|
+
/** @public */
|
|
6
6
|
constructor(
|
|
7
|
-
/** @
|
|
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
|
|
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"}
|
package/dist/json-data.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** Validate and detach JSON data without silently dropping unsupported values. @
|
|
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
|
package/dist/json-data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-data.d.ts","sourceRoot":"","sources":["../src/json-data.ts"],"names":[],"mappings":"AAAA,
|
|
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
|
-
/** @
|
|
5
|
+
/** @public */
|
|
6
6
|
id: number;
|
|
7
7
|
/** @public */
|
|
8
8
|
body: string;
|
|
9
|
-
/** @
|
|
9
|
+
/** @public */
|
|
10
10
|
createdAt: string;
|
|
11
11
|
/** @public */
|
|
12
12
|
author: string;
|
|
13
|
-
/** @
|
|
13
|
+
/** @public */
|
|
14
14
|
path?: string;
|
|
15
|
-
/** @
|
|
15
|
+
/** @public */
|
|
16
16
|
line?: number | null;
|
|
17
17
|
}
|
|
18
|
-
/** Batch already-authorized, unseen feedback after its quiet period. @
|
|
19
|
-
export declare function repositoryFeedbackBatch(unseen: readonly RepositoryFeedbackItem[], config:
|
|
20
|
-
|
|
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
|
-
}
|
|
23
|
-
|
|
35
|
+
}
|
|
36
|
+
/** @public */
|
|
37
|
+
export interface RepositoryFeedbackBatch {
|
|
38
|
+
/** @public */
|
|
24
39
|
event: {
|
|
25
|
-
/** @
|
|
40
|
+
/** @public */
|
|
26
41
|
feedbackIds: {
|
|
27
|
-
/** @
|
|
28
|
-
kind: "
|
|
29
|
-
/** @
|
|
42
|
+
/** @public */
|
|
43
|
+
kind: RepositoryFeedbackItem["kind"];
|
|
44
|
+
/** @public */
|
|
30
45
|
id: number;
|
|
31
46
|
}[];
|
|
32
|
-
/** @
|
|
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
|
-
/** @
|
|
50
|
+
/** @public */
|
|
43
51
|
mergeKey: string;
|
|
44
|
-
}
|
|
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,
|
|
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. @
|
|
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,
|
|
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
|
-
/** @
|
|
4
|
+
/** @public */
|
|
4
5
|
profile: string;
|
|
5
|
-
/** @
|
|
6
|
+
/** @public */
|
|
6
7
|
pollInterval: string;
|
|
7
|
-
/** @
|
|
8
|
+
/** @public */
|
|
8
9
|
repositories: {
|
|
9
|
-
/** @
|
|
10
|
+
/** @public */
|
|
10
11
|
include: readonly string[];
|
|
11
|
-
/** @
|
|
12
|
+
/** @public */
|
|
12
13
|
exclude: readonly string[];
|
|
13
14
|
};
|
|
14
|
-
/** @
|
|
15
|
+
/** @public */
|
|
15
16
|
labels: {
|
|
16
|
-
/** @
|
|
17
|
+
/** @public */
|
|
17
18
|
trigger: string;
|
|
18
|
-
/** @
|
|
19
|
+
/** @public */
|
|
19
20
|
done: string;
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
/** @
|
|
23
|
+
/** @public */
|
|
23
24
|
export declare function matchesRepository(config: Pick<RepositoryIssueWatcherConfig, "repositories">, repository: {
|
|
24
|
-
/** @
|
|
25
|
+
/** @public */
|
|
25
26
|
full_name: string;
|
|
26
27
|
}): boolean;
|
|
27
|
-
/** Parse shared issue watcher fields; extensions choose the legacy type and label policy. @
|
|
28
|
-
export declare function parseRepositoryIssueWatcherConfig(raw: unknown, legacyType: string, distinctLabels?: boolean):
|
|
29
|
-
|
|
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
|
-
/** @
|
|
36
|
+
/** @public */
|
|
32
37
|
enabled: boolean;
|
|
33
|
-
/** @
|
|
34
|
-
launchModelConfig:
|
|
35
|
-
/** @
|
|
38
|
+
/** @public */
|
|
39
|
+
launchModelConfig: LaunchModelConfigInput & {
|
|
40
|
+
/** @public */
|
|
36
41
|
skillIds: string[];
|
|
37
42
|
};
|
|
38
|
-
}
|
|
39
|
-
/** @
|
|
40
|
-
export
|
|
41
|
-
/** @
|
|
43
|
+
}
|
|
44
|
+
/** @public */
|
|
45
|
+
export interface RepositoryIssueWatcherPresentation {
|
|
46
|
+
/** @public */
|
|
42
47
|
targetSummary: string;
|
|
43
|
-
/** @
|
|
48
|
+
/** @public */
|
|
44
49
|
details: {
|
|
45
|
-
/** @
|
|
50
|
+
/** @public */
|
|
46
51
|
label: string;
|
|
47
|
-
/** @
|
|
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":"
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
/** @
|
|
12
|
+
/** @public */
|
|
6
13
|
owner: string;
|
|
7
|
-
/** @
|
|
14
|
+
/** @public */
|
|
8
15
|
repo: string;
|
|
9
|
-
/** @
|
|
16
|
+
/** @public */
|
|
10
17
|
prNumber: number;
|
|
11
|
-
/** @
|
|
18
|
+
/** @public */
|
|
12
19
|
pollInterval: string;
|
|
13
|
-
/** @
|
|
20
|
+
/** @public */
|
|
14
21
|
terminalOutcome: "merged" | "closed" | undefined;
|
|
15
|
-
/** @
|
|
22
|
+
/** @public */
|
|
16
23
|
disabled: boolean;
|
|
17
|
-
}
|
|
18
|
-
/** @
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
/** @
|
|
32
|
+
/** @public */
|
|
31
33
|
owner: string;
|
|
32
|
-
/** @
|
|
34
|
+
/** @public */
|
|
33
35
|
repo: string;
|
|
34
|
-
/** @
|
|
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
|
-
/** @
|
|
38
|
+
/** @public */
|
|
54
39
|
triggerLabel: string;
|
|
55
|
-
/** @
|
|
40
|
+
/** @public */
|
|
56
41
|
pollInterval: string;
|
|
57
|
-
}
|
|
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":"
|
|
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"}
|
package/dist/subprocess-env.d.ts
CHANGED
|
@@ -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
|
-
/** @
|
|
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,
|
|
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"}
|
package/dist/tool-arguments.d.ts
CHANGED
|
@@ -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
|
-
/** @
|
|
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. @
|
|
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
|
-
/** @
|
|
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,
|
|
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.
|
|
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.
|
|
47
|
-
"@leitwerk-dev/protocol": "0.
|
|
48
|
-
"@leitwerk-dev/worker-protocol": "0.
|
|
49
|
-
"@leitwerk-dev/watcher-utils": "0.
|
|
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.
|
|
53
|
+
"@leitwerk-dev/external-writes": "0.3.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/escape-html": "^1.0.4",
|
package/src/core-capabilities.ts
CHANGED
|
@@ -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 */
|
package/src/extension-api.ts
CHANGED
|
@@ -948,13 +948,13 @@ export interface CatalogExtensionAPI {
|
|
|
948
948
|
/** @public */
|
|
949
949
|
export type ExtensionLifecycleHook = () => void | Promise<void>;
|
|
950
950
|
|
|
951
|
-
/** @
|
|
951
|
+
/** @public */
|
|
952
952
|
export interface ServerExtensionLogger {
|
|
953
|
-
/** @
|
|
953
|
+
/** @public */
|
|
954
954
|
info?(payload: Record<string, unknown>, message?: string): void;
|
|
955
|
-
/** @
|
|
955
|
+
/** @public */
|
|
956
956
|
warn?(payload: Record<string, unknown>, message?: string): void;
|
|
957
|
-
/** @
|
|
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
|
-
/** @
|
|
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
|
-
/** @
|
|
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. @
|
|
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
|
-
/** @
|
|
14
|
+
/** @public */
|
|
15
15
|
created: string[];
|
|
16
|
-
/** @
|
|
16
|
+
/** @public */
|
|
17
17
|
errors: string[];
|
|
18
18
|
},
|
|
19
19
|
options: {
|
|
20
|
-
/** @
|
|
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
|
-
|
|
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
|
-
/** @
|
|
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
|
-
/** @
|
|
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 {
|
|
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,
|
package/src/integration-http.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** An HTTP failure without provider response bodies or credentials. @
|
|
1
|
+
/** An HTTP failure without provider response bodies or credentials. @public */
|
|
2
2
|
export class IntegrationHttpError extends Error {
|
|
3
|
-
/** @
|
|
3
|
+
/** @public */
|
|
4
4
|
constructor(
|
|
5
|
-
/** @
|
|
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. @
|
|
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",
|