@leitwerk-dev/process-sdk 0.2.0 → 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/browser-ui-extension.d.ts +20 -0
- package/dist/browser-ui-extension.d.ts.map +1 -1
- package/dist/capabilities.d.ts +6 -0
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/{chunk-LIIP7FMU.js → chunk-5R6MVLHC.js} +1 -1
- package/dist/chunk-5R6MVLHC.js.map +1 -0
- package/dist/chunk-DVXW2ZUV.js +1 -0
- package/dist/chunk-DVXW2ZUV.js.map +1 -0
- package/dist/{chunk-TA4KO53Q.js → chunk-I7U6HCLN.js} +1 -7
- package/dist/chunk-I7U6HCLN.js.map +1 -0
- package/dist/{chunk-WFY2WWZE.js → chunk-TM2LTSW4.js} +1 -1
- package/dist/chunk-TM2LTSW4.js.map +1 -0
- package/dist/codecs.d.ts +1 -0
- package/dist/codecs.d.ts.map +1 -1
- package/dist/commit-message.d.ts +5 -0
- package/dist/commit-message.d.ts.map +1 -1
- package/dist/core-capabilities.d.ts +338 -20
- package/dist/core-capabilities.d.ts.map +1 -1
- package/dist/define-process.d.ts +195 -18
- package/dist/define-process.d.ts.map +1 -1
- package/dist/event-bus.d.ts +1 -0
- package/dist/event-bus.d.ts.map +1 -1
- package/dist/{extension-api-CcqZCYJx.d.ts → extension-api-3Vr3RE8S.d.ts} +1000 -108
- package/dist/extension-api.d.ts +385 -50
- package/dist/extension-api.d.ts.map +1 -1
- package/dist/external-action-source.d.ts +3 -1
- package/dist/external-action-source.d.ts.map +1 -1
- package/dist/external-source-poll.d.ts +18 -5
- package/dist/external-source-poll.d.ts.map +1 -1
- package/dist/flow.d.ts +308 -11
- package/dist/flow.d.ts.map +1 -1
- package/dist/form-contract.d.ts +1 -1
- package/dist/form-contract.d.ts.map +1 -1
- package/dist/fs-utils.d.ts +4 -0
- package/dist/fs-utils.d.ts.map +1 -1
- package/dist/git-binary.d.ts +2 -1
- package/dist/git-binary.d.ts.map +1 -1
- package/dist/git-binary.js.map +1 -1
- package/dist/graph-fragments.d.ts +16 -0
- package/dist/graph-fragments.d.ts.map +1 -1
- package/dist/host-capabilities.d.ts +9 -3
- package/dist/host-capabilities.d.ts.map +1 -1
- package/dist/index.d.ts +26 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +270 -81
- package/dist/index.js.map +1 -1
- package/dist/integration-http.d.ts +14 -3
- 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/leaf-outcome-renderer.d.ts +35 -0
- package/dist/leaf-outcome-renderer.d.ts.map +1 -1
- package/dist/leaf-outcome-renderer.js +12 -0
- package/dist/leaf-outcome-renderer.js.map +1 -1
- package/dist/leaf-outcomes.d.ts +3 -0
- package/dist/leaf-outcomes.d.ts.map +1 -1
- package/dist/model-provider.d.ts +144 -12
- package/dist/model-provider.d.ts.map +1 -1
- package/dist/pi-config-public.d.ts +2 -0
- package/dist/pi-config-public.d.ts.map +1 -0
- package/dist/pi-config-public.js +15 -0
- package/dist/pi-config-public.js.map +1 -0
- package/dist/pi-config.d.ts +40 -0
- package/dist/pi-config.d.ts.map +1 -1
- package/dist/pi-config.js +1 -1
- package/dist/process-definition-internals.d.ts +4 -0
- package/dist/process-definition-internals.d.ts.map +1 -1
- package/dist/process-flow-view.d.ts +2 -0
- package/dist/process-flow-view.d.ts.map +1 -1
- package/dist/process-graph.d.ts +34 -0
- package/dist/process-graph.d.ts.map +1 -1
- package/dist/process-launcher-builder.d.ts +5 -0
- package/dist/process-launcher-builder.d.ts.map +1 -1
- package/dist/process-watcher-builder.d.ts +5 -0
- package/dist/process-watcher-builder.d.ts.map +1 -1
- package/dist/process-watcher-source.d.ts +3 -1
- package/dist/process-watcher-source.d.ts.map +1 -1
- package/dist/project-binding.d.ts +5 -1
- package/dist/project-binding.d.ts.map +1 -1
- package/dist/registry-utils.d.ts +6 -0
- package/dist/registry-utils.d.ts.map +1 -1
- package/dist/repository-feedback.d.ts +36 -12
- package/dist/repository-feedback.d.ts.map +1 -1
- package/dist/repository-git-env.d.ts +6 -2
- package/dist/repository-git-env.d.ts.map +1 -1
- package/dist/repository-http.d.ts +13 -1
- package/dist/repository-http.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 +31 -6
- package/dist/repository-issue-watcher.d.ts.map +1 -1
- package/dist/repository-reconciliation.d.ts +5 -0
- package/dist/repository-reconciliation.d.ts.map +1 -0
- package/dist/repository-source-config.d.ts +29 -18
- package/dist/repository-source-config.d.ts.map +1 -1
- package/dist/repository-types.d.ts +28 -1
- package/dist/repository-types.d.ts.map +1 -1
- package/dist/review-flow-public.d.ts +2 -0
- package/dist/review-flow-public.d.ts.map +1 -0
- package/dist/review-flow-public.js +11 -0
- package/dist/review-flow-public.js.map +1 -0
- package/dist/review-flow.d.ts +6 -0
- package/dist/review-flow.d.ts.map +1 -1
- package/dist/review-flow.js +1 -1
- package/dist/runtime-internals-public.d.ts +2 -0
- package/dist/runtime-internals-public.d.ts.map +1 -0
- package/dist/runtime-internals-public.js +16 -0
- package/dist/runtime-internals-public.js.map +1 -0
- package/dist/runtime-internals.js +2 -1
- package/dist/server-events.d.ts +67 -0
- package/dist/server-events.d.ts.map +1 -1
- package/dist/server-process-builder.d.ts +7 -0
- package/dist/server-process-builder.d.ts.map +1 -1
- package/dist/state-helpers.d.ts +6 -0
- package/dist/state-helpers.d.ts.map +1 -1
- package/dist/subprocess-env.d.ts +3 -0
- package/dist/subprocess-env.d.ts.map +1 -1
- package/dist/tool-arguments.d.ts +4 -2
- package/dist/tool-arguments.d.ts.map +1 -1
- package/dist/tool-renderers.d.ts +6 -0
- package/dist/tool-renderers.d.ts.map +1 -1
- package/dist/turn-semantics.d.ts +14 -1
- package/dist/turn-semantics.d.ts.map +1 -1
- package/dist/types.d.ts +205 -24
- package/dist/types.d.ts.map +1 -1
- package/dist/ui-process-builder.d.ts +5 -0
- package/dist/ui-process-builder.d.ts.map +1 -1
- package/dist/worker-process-builder.d.ts +5 -0
- package/dist/worker-process-builder.d.ts.map +1 -1
- package/package.json +16 -15
- package/src/browser-ui-extension.ts +20 -0
- package/src/capabilities.ts +9 -1
- package/src/codecs.ts +1 -0
- package/src/commit-message.ts +5 -0
- package/src/core-capabilities.ts +398 -35
- package/src/define-process.ts +198 -23
- package/src/event-bus.ts +1 -0
- package/src/extension-api.ts +399 -55
- package/src/external-action-source.ts +7 -2
- package/src/external-source-poll.ts +72 -6
- package/src/flow.ts +352 -23
- package/src/form-contract.ts +0 -4
- package/src/fs-utils.ts +4 -0
- package/src/git-binary.ts +2 -1
- package/src/graph-fragments.ts +16 -0
- package/src/host-capabilities.ts +9 -6
- package/src/index.ts +14 -202
- package/src/integration-http.ts +15 -3
- package/src/json-data.ts +1 -1
- package/src/leaf-outcome-renderer.ts +35 -0
- package/src/leaf-outcomes.ts +3 -0
- package/src/model-provider.ts +169 -20
- package/src/pi-config-public.ts +7 -0
- package/src/pi-config.ts +47 -2
- package/src/process-definition-internals.ts +4 -0
- package/src/process-flow-view.ts +2 -0
- package/src/process-graph.ts +34 -0
- package/src/process-launcher-builder.ts +5 -0
- package/src/process-watcher-builder.ts +5 -0
- package/src/process-watcher-source.ts +6 -4
- package/src/project-binding.ts +5 -1
- package/src/registry-utils.ts +6 -0
- package/src/repository-feedback.ts +59 -5
- package/src/repository-git-env.ts +6 -2
- package/src/repository-http.ts +19 -2
- package/src/repository-https.ts +1 -1
- package/src/repository-issue-watcher.ts +64 -7
- package/src/repository-reconciliation.ts +30 -0
- package/src/repository-source-config.ts +66 -4
- package/src/repository-types.ts +43 -5
- package/src/review-flow-public.ts +5 -0
- package/src/review-flow.ts +6 -0
- package/src/runtime-internals-public.ts +7 -0
- package/src/server-events.ts +67 -0
- package/src/server-process-builder.ts +10 -1
- package/src/state-helpers.ts +6 -0
- package/src/subprocess-env.ts +3 -0
- package/src/tool-arguments.ts +4 -2
- package/src/tool-renderers.ts +6 -0
- package/src/turn-semantics.ts +15 -2
- package/src/types.ts +212 -30
- package/src/ui-process-builder.ts +8 -1
- package/src/worker-process-builder.ts +8 -1
- package/dist/chunk-LIIP7FMU.js.map +0 -1
- package/dist/chunk-TA4KO53Q.js.map +0 -1
- package/dist/chunk-WFY2WWZE.js.map +0 -1
package/src/form-contract.ts
CHANGED
|
@@ -3,9 +3,5 @@ export type {
|
|
|
3
3
|
ActionFormDefinition as FormDefinition,
|
|
4
4
|
ActionFormFieldDefinition,
|
|
5
5
|
ActionFormFieldDefinition as FormFieldDefinition,
|
|
6
|
-
ActionFormFieldKind,
|
|
7
|
-
FormFieldKind,
|
|
8
6
|
FormFieldOptionDefinition,
|
|
9
|
-
FormFieldPublishDefinition,
|
|
10
|
-
FormFieldStateDefinition,
|
|
11
7
|
} from "@leitwerk-dev/protocol/form-contract";
|
package/src/fs-utils.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { mkdir, rename, unlink, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
/** @internal */
|
|
5
6
|
export async function atomicWriteUtf8(filePath: string, content: string): Promise<void> {
|
|
6
7
|
const dir = path.dirname(filePath);
|
|
7
8
|
await mkdir(dir, { recursive: true });
|
|
@@ -19,6 +20,7 @@ export async function atomicWriteUtf8(filePath: string, content: string): Promis
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
// The parent itself is not inside: callers require a strict descendant.
|
|
23
|
+
/** @internal */
|
|
22
24
|
export function isPathInside(parent: string, child: string): boolean {
|
|
23
25
|
const relative = path.relative(parent, child);
|
|
24
26
|
return (
|
|
@@ -29,6 +31,7 @@ export function isPathInside(parent: string, child: string): boolean {
|
|
|
29
31
|
);
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
/** @internal */
|
|
32
35
|
export function hasErrorCode(error: unknown, code: string): boolean {
|
|
33
36
|
return (
|
|
34
37
|
typeof error === "object" &&
|
|
@@ -38,6 +41,7 @@ export function hasErrorCode(error: unknown, code: string): boolean {
|
|
|
38
41
|
);
|
|
39
42
|
}
|
|
40
43
|
|
|
44
|
+
/** @internal */
|
|
41
45
|
export function isEnoent(error: unknown): boolean {
|
|
42
46
|
return hasErrorCode(error, "ENOENT");
|
|
43
47
|
}
|
package/src/git-binary.ts
CHANGED
|
@@ -15,6 +15,7 @@ let cachedGitBinary: string | null = null;
|
|
|
15
15
|
* to the bare `"git"` name when no PATH entry matches so spawning still works
|
|
16
16
|
* and surfaces a clear error from the child process itself.
|
|
17
17
|
*/
|
|
18
|
+
/** @public */
|
|
18
19
|
export function resolveGitBinary(): string {
|
|
19
20
|
if (cachedGitBinary) {
|
|
20
21
|
return cachedGitBinary;
|
|
@@ -34,7 +35,7 @@ export function resolveGitBinary(): string {
|
|
|
34
35
|
return cachedGitBinary;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
/** Reset the cached resolution. Intended for tests that mutate PATH. */
|
|
38
|
+
/** Reset the cached resolution. Intended for tests that mutate PATH. @internal */
|
|
38
39
|
export function resetGitBinaryCache(): void {
|
|
39
40
|
cachedGitBinary = null;
|
|
40
41
|
}
|
package/src/graph-fragments.ts
CHANGED
|
@@ -6,7 +6,9 @@ import type {
|
|
|
6
6
|
ProcessHumanTurnActionSpec,
|
|
7
7
|
} from "./define-process.js";
|
|
8
8
|
|
|
9
|
+
/** @internal */
|
|
9
10
|
type MaybePromise<T> = T | Promise<T>;
|
|
11
|
+
/** @internal */
|
|
10
12
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
11
13
|
|
|
12
14
|
function appendQueuedInstruction<TState>(input: {
|
|
@@ -36,19 +38,26 @@ function appendQueuedInstruction<TState>(input: {
|
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
/** @internal */
|
|
39
42
|
export type QueuedInstructionActionSpec<TParams = unknown, TState = unknown> = DistributiveOmit<
|
|
40
43
|
ProcessHumanTurnActionSpec<TParams, TState>,
|
|
41
44
|
"effect"
|
|
42
45
|
> & {
|
|
46
|
+
/** @internal */
|
|
43
47
|
queueTarget?: ProcessInputTarget;
|
|
48
|
+
/** @internal */
|
|
44
49
|
queueSource?: InputSource;
|
|
50
|
+
/** @internal */
|
|
45
51
|
queueKind?: InputKind;
|
|
52
|
+
/** @internal */
|
|
46
53
|
resolveBodyMarkdown(
|
|
47
54
|
input: ProcessActionExecution<TParams, TState>,
|
|
48
55
|
): MaybePromise<string | null | undefined>;
|
|
56
|
+
/** @internal */
|
|
49
57
|
effect?: ProcessActionEffect<TParams, TState>;
|
|
50
58
|
};
|
|
51
59
|
|
|
60
|
+
/** @internal */
|
|
52
61
|
export function queuedInstructionAction<TParams = unknown, TState = unknown>(
|
|
53
62
|
spec: QueuedInstructionActionSpec<TParams, TState>,
|
|
54
63
|
): ProcessHumanTurnActionSpec<TParams, TState> {
|
|
@@ -69,14 +78,18 @@ export function queuedInstructionAction<TParams = unknown, TState = unknown>(
|
|
|
69
78
|
} as ProcessHumanTurnActionSpec<TParams, TState>;
|
|
70
79
|
}
|
|
71
80
|
|
|
81
|
+
/** @internal */
|
|
72
82
|
export type RevisionActionSpec<TParams = unknown, TState = unknown> = DistributiveOmit<
|
|
73
83
|
QueuedInstructionActionSpec<TParams, TState>,
|
|
74
84
|
"resolveBodyMarkdown"
|
|
75
85
|
> & {
|
|
86
|
+
/** @internal */
|
|
76
87
|
messageFieldId?: string;
|
|
88
|
+
/** @internal */
|
|
77
89
|
missingMessageError?: string;
|
|
78
90
|
};
|
|
79
91
|
|
|
92
|
+
/** @internal */
|
|
80
93
|
export function revisionAction<TParams = unknown, TState = unknown>(
|
|
81
94
|
spec: RevisionActionSpec<TParams, TState>,
|
|
82
95
|
): ProcessHumanTurnActionSpec<TParams, TState> {
|
|
@@ -93,13 +106,16 @@ export function revisionAction<TParams = unknown, TState = unknown>(
|
|
|
93
106
|
});
|
|
94
107
|
}
|
|
95
108
|
|
|
109
|
+
/** @internal */
|
|
96
110
|
export type AcceptedReviewHandoffActionSpec<TParams = unknown, TState = unknown> = DistributiveOmit<
|
|
97
111
|
QueuedInstructionActionSpec<TParams, TState>,
|
|
98
112
|
"queueTarget"
|
|
99
113
|
> & {
|
|
114
|
+
/** @internal */
|
|
100
115
|
queueTarget?: ProcessInputTarget;
|
|
101
116
|
};
|
|
102
117
|
|
|
118
|
+
/** @internal */
|
|
103
119
|
export function acceptedReviewHandoffAction<TParams = unknown, TState = unknown>(
|
|
104
120
|
spec: AcceptedReviewHandoffActionSpec<TParams, TState>,
|
|
105
121
|
): ProcessHumanTurnActionSpec<TParams, TState> {
|
package/src/host-capabilities.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import type { CapabilityToken } from "./capabilities.js";
|
|
2
2
|
|
|
3
|
+
/** @internal */
|
|
3
4
|
export interface ProvidedCapability<T = unknown> {
|
|
5
|
+
/** @internal */
|
|
4
6
|
token: CapabilityToken<T>;
|
|
7
|
+
/** @internal */
|
|
5
8
|
value: T;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
/** @internal */
|
|
12
|
+
export function createCapabilityAccessor(provided: readonly ProvidedCapability[] = []): {
|
|
13
|
+
/** @internal */
|
|
9
14
|
provide<T>(token: CapabilityToken<T>, value: T): void;
|
|
15
|
+
/** @internal */
|
|
10
16
|
get<T>(token: CapabilityToken<T>): T | T[] | undefined;
|
|
17
|
+
/** @internal */
|
|
11
18
|
require<T>(token: CapabilityToken<T>): T | T[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function createCapabilityAccessor(
|
|
15
|
-
provided: readonly ProvidedCapability[] = [],
|
|
16
|
-
): CapabilityAccessor {
|
|
19
|
+
} {
|
|
17
20
|
const singleCapabilities = new Map<string, unknown>();
|
|
18
21
|
const multiCapabilities = new Map<string, unknown[]>();
|
|
19
22
|
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ export type {
|
|
|
7
7
|
BrowserUiWsFrameHandler,
|
|
8
8
|
} from "./browser-ui-extension.js";
|
|
9
9
|
export {
|
|
10
|
-
type CapabilityCardinality,
|
|
11
10
|
type CapabilityToken,
|
|
12
11
|
createCapabilityToken,
|
|
13
12
|
} from "./capabilities.js";
|
|
@@ -20,12 +19,8 @@ export {
|
|
|
20
19
|
export {
|
|
21
20
|
type ActionExecutionFailureStageLike,
|
|
22
21
|
type ActionExecutionResultLike,
|
|
23
|
-
type BroadcasterLike,
|
|
24
|
-
type ComponentConfigLike,
|
|
25
22
|
type CoreServerSetupDeps,
|
|
26
23
|
coreHostCapabilities,
|
|
27
|
-
type DeferredProcessActivationEvent,
|
|
28
|
-
type DeferredProcessActivationExpected,
|
|
29
24
|
type DeferredProcessActivationFailure,
|
|
30
25
|
type DeferredProcessActivationOutcome,
|
|
31
26
|
type DeferredProcessActivationSnapshot,
|
|
@@ -36,137 +31,84 @@ export {
|
|
|
36
31
|
type ExternalSourceFireInput,
|
|
37
32
|
type ExternalSourceServiceLike,
|
|
38
33
|
type HandoffDedupKeyRecordLike,
|
|
39
|
-
type HandoffDedupKeyServiceLike,
|
|
40
34
|
type LauncherModelConfigPreviewLike,
|
|
41
35
|
type LauncherModelConfigSchemaLike,
|
|
42
36
|
type LauncherModelConfigServiceLike,
|
|
43
|
-
type LauncherRecentValuesServiceLike,
|
|
44
37
|
type LaunchModelConfigInputLike,
|
|
45
38
|
type LaunchPlanPreparationIssue,
|
|
46
39
|
type LaunchPlanPreparationIssueCode,
|
|
47
40
|
type LaunchPlanPreparationResultLike,
|
|
48
|
-
type LaunchRunServiceLike,
|
|
49
41
|
type ModelProfileOptionSummaryLike,
|
|
50
|
-
type PollingHandleLike,
|
|
51
42
|
type PollingServiceLike,
|
|
52
|
-
type PollResultLike,
|
|
53
43
|
type PreparedDeferredProcessActivation,
|
|
54
44
|
type ProcessActionExecutionOrigin,
|
|
55
45
|
type ProcessActionExecutionSource,
|
|
56
46
|
type ProcessActionModelPreviewLike,
|
|
57
47
|
type ProcessActionServiceLike,
|
|
58
48
|
type ProcessActionSummaryLike,
|
|
59
|
-
type ProcessCreateInputLike,
|
|
60
49
|
type ProcessEngineLike,
|
|
61
|
-
type ProcessEngineResultLike,
|
|
62
|
-
type ProcessEventRepoLike,
|
|
63
50
|
type ProcessLaunchPlanServiceLike,
|
|
64
|
-
type ProcessModelSelectionPreviewFailureCode,
|
|
65
51
|
type ProcessModelSelectionPreviewResultLike,
|
|
66
52
|
type ProcessModelSelectionServiceLike,
|
|
67
53
|
type ProcessProjectRepoLike,
|
|
68
54
|
type ProcessQuestionServiceLike,
|
|
69
|
-
type ProcessRepoLike,
|
|
70
55
|
type ProcessWatcherServiceLike,
|
|
71
56
|
type ProgrammaticLaunchRequestLike,
|
|
72
57
|
type ProgrammaticLaunchResultLike,
|
|
73
58
|
type QueuedProcessInputLike,
|
|
74
59
|
type RegisteredProcessWatcherLike,
|
|
75
60
|
type WatcherLaunchResultLike,
|
|
76
|
-
type WorkerSupervisorLike,
|
|
77
61
|
} from "./core-capabilities.js";
|
|
78
62
|
export {
|
|
79
63
|
type AutomaticTurnDefinition,
|
|
80
64
|
automaticTurn,
|
|
81
|
-
type DefinedProcessInput,
|
|
82
65
|
defineProcess,
|
|
83
66
|
type ExternalSourceTransition,
|
|
84
|
-
type ExternalTurnDefinition,
|
|
85
|
-
externalTurn,
|
|
86
67
|
getExternalActionArmingId,
|
|
87
68
|
getExternalActionTransitionTrigger,
|
|
88
69
|
getExternalSourceTransitionId,
|
|
89
70
|
type HumanTurnDefinition,
|
|
90
|
-
type HumanTurnOperatorAttention,
|
|
91
71
|
humanTurn,
|
|
92
|
-
type LlmModelPurpose,
|
|
93
72
|
type LlmTurnDefinition,
|
|
94
|
-
type LlmTurnPreparationContext,
|
|
95
73
|
llmTurn,
|
|
96
|
-
type OutcomeRouteOptions,
|
|
97
|
-
type OutcomeRouteSpec,
|
|
98
|
-
type ProcessActionBranchSelector,
|
|
99
|
-
type ProcessActionBranchSpec,
|
|
100
|
-
type ProcessActionEffect,
|
|
101
|
-
type ProcessActionExecution,
|
|
102
|
-
type ProcessActionExternalTrigger,
|
|
103
|
-
type ProcessBroadcastEffect,
|
|
104
|
-
type ProcessDefinition,
|
|
105
74
|
type ProcessEffectPlan,
|
|
106
|
-
type ProcessHumanTurnActionSpec,
|
|
107
75
|
type ProcessHumanTurnExternalActionSpec,
|
|
108
76
|
type ProcessLifecycleEffects,
|
|
109
|
-
type ProcessOutcomeBranchSelector,
|
|
110
|
-
type ProcessOutcomeBranchSpec,
|
|
111
|
-
type ProcessOutcomeEffect,
|
|
112
|
-
type ProcessOutcomeExecution,
|
|
113
|
-
type ProcessPatchEffect,
|
|
114
|
-
type ProcessRuntimeTurnContext,
|
|
115
|
-
type ProcessServerRuntimeContext,
|
|
116
77
|
type ProcessToolOutcomeSpec,
|
|
117
|
-
type ProcessTurnEndSpec,
|
|
118
78
|
resolveHumanTurnView,
|
|
119
79
|
routeTurnOutcomes,
|
|
120
80
|
type TurnDefinition,
|
|
121
|
-
type TurnDefinitionRecord,
|
|
122
81
|
} from "./define-process.js";
|
|
123
82
|
export { createEventBus } from "./event-bus.js";
|
|
124
83
|
export type {
|
|
125
84
|
CatalogExtensionAPI,
|
|
126
85
|
Codec,
|
|
127
|
-
ExtensionLifecycleHook,
|
|
128
86
|
ExtensionProcessDefinition,
|
|
129
87
|
ExternalActionSource,
|
|
130
88
|
ExternalEventDescription,
|
|
131
|
-
ExternalSourceEffect,
|
|
132
|
-
ExternalSourceEffectContext,
|
|
133
|
-
ExternalSourceInputMode,
|
|
134
89
|
ExternalSourceResolveContext,
|
|
135
90
|
FormDefinition,
|
|
136
91
|
FormFieldDefinition,
|
|
137
|
-
GitHttpsCredentialMaterial,
|
|
138
92
|
GitSshCredentialMaterial,
|
|
139
93
|
IntegrationToolDefinition,
|
|
140
94
|
IntegrationToolExecutionContext,
|
|
141
95
|
LauncherContext,
|
|
142
96
|
LauncherModelProfileSummary,
|
|
143
|
-
LauncherVisibility,
|
|
144
97
|
LaunchPreparationCheck,
|
|
145
|
-
LaunchPreparationContext,
|
|
146
|
-
LeafOutcomeCaptureContext,
|
|
147
98
|
LeafOutcomeCaptureResult,
|
|
148
|
-
LeitwerkExtensionManifest,
|
|
149
99
|
LeitwerkExtensionModule,
|
|
150
|
-
ParsedProcessWatcherConfig,
|
|
151
100
|
ProcessActionDefinition,
|
|
152
101
|
ProcessLaunchConfig,
|
|
153
|
-
ProcessLauncherAPI,
|
|
154
102
|
ProcessLauncherDefinition,
|
|
155
103
|
ProcessLauncherService,
|
|
156
104
|
ProcessLaunchPlan,
|
|
157
|
-
ProcessLaunchPlanProcessInput,
|
|
158
105
|
ProcessLaunchProjectConfig,
|
|
159
106
|
ProcessLeafOutcomeDefinition,
|
|
160
|
-
ProcessSnapshotContext,
|
|
161
107
|
ProcessTitleSourceField,
|
|
162
108
|
ProcessTurnBinding,
|
|
163
|
-
ProcessTurnOutcomeEvent,
|
|
164
|
-
ProcessWatcherAPI,
|
|
165
109
|
ProcessWatcherDefinition,
|
|
166
110
|
ProcessWatcherPresentation,
|
|
167
|
-
ProcessWatcherPresentationField,
|
|
168
111
|
ProcessWatcherSource,
|
|
169
|
-
RepositoryCredentialKind,
|
|
170
112
|
RepositoryCredentialProject,
|
|
171
113
|
RepositoryCredentialProvider,
|
|
172
114
|
RepositoryCredentialRegistrar,
|
|
@@ -174,101 +116,60 @@ export type {
|
|
|
174
116
|
ResolvedProcessLauncher,
|
|
175
117
|
ServerExtensionAPI,
|
|
176
118
|
ServerExtensionLogger,
|
|
177
|
-
ServerProcessAPI,
|
|
178
119
|
ServerProcessContext,
|
|
179
|
-
ServerTransitionEffect,
|
|
180
120
|
ServerTransitionRequest,
|
|
181
|
-
ServerTransitionRuntime,
|
|
182
121
|
TicketCreationCapability,
|
|
183
|
-
TicketCreationDestinationContext,
|
|
184
122
|
TicketCreationDestinationList,
|
|
185
123
|
TicketCreationDestinationProvider,
|
|
186
124
|
TicketCreationDestinationSnapshot,
|
|
187
125
|
TicketCreationDestinationSummary,
|
|
188
126
|
TicketCreationReceipt,
|
|
189
|
-
UiLauncherConfigResolution,
|
|
190
127
|
UiLauncherDefinition,
|
|
191
|
-
UiLauncherResolutionResult,
|
|
192
128
|
UiLauncherSummary,
|
|
193
|
-
UiProcessAPI,
|
|
194
129
|
WorkerCompleteInput,
|
|
195
130
|
WorkerExtensionAPI,
|
|
196
|
-
WorkerProcessAPI,
|
|
197
131
|
WorkerProcessContext,
|
|
198
132
|
WorkerRunHandle,
|
|
199
133
|
WorkerTurnHandler,
|
|
200
134
|
} from "./extension-api.js";
|
|
201
135
|
export { findUiLauncherById, SafeLaunchPreparationError } from "./extension-api.js";
|
|
202
136
|
export { defineExternalActionSource } from "./external-action-source.js";
|
|
203
|
-
export { createExternalSourcePollReporter } from "./external-source-poll.js";
|
|
204
137
|
export {
|
|
205
|
-
|
|
138
|
+
createExternalSourcePollReporter,
|
|
139
|
+
type ExternalSourcePollReporter,
|
|
140
|
+
} from "./external-source-poll.js";
|
|
141
|
+
export {
|
|
206
142
|
AutomaticOutcomeBuilder,
|
|
207
|
-
createFlowAutomaticRunContext,
|
|
208
143
|
createFlowPromptContext,
|
|
209
|
-
DEFAULT_FLOW_PRODUCT_NAME,
|
|
210
|
-
DEFAULT_PLAN_RESULT_OUTCOME_ID,
|
|
211
|
-
ExternalActionBuilder,
|
|
212
|
-
ExternalFlowBuilder,
|
|
213
|
-
ExternalRouteBuilder,
|
|
214
|
-
type FlowAutomaticOutcomeEffectContext,
|
|
215
144
|
type FlowAutomaticRunContext,
|
|
216
|
-
type FlowAutomaticTurn,
|
|
217
|
-
type FlowExternalTurn,
|
|
218
145
|
FlowFragmentBuilder,
|
|
219
|
-
type FlowHumanTurn,
|
|
220
|
-
type FlowLlmOutcomeEffectContext,
|
|
221
146
|
type FlowLlmPreparationContext,
|
|
222
|
-
type FlowLlmTurn,
|
|
223
|
-
FlowProcessBuilder,
|
|
224
147
|
type FlowPromptContext,
|
|
225
|
-
type FlowRepoContext,
|
|
226
|
-
type FlowRepoLookup,
|
|
227
|
-
type FlowTurn,
|
|
228
148
|
flow,
|
|
229
|
-
HumanActionBuilder,
|
|
230
149
|
HumanFlowBuilder,
|
|
231
|
-
LlmFlowBuilder,
|
|
232
|
-
LlmTurnEndBuilder,
|
|
233
|
-
OutcomeToolBuilder,
|
|
234
|
-
type PlanAcceptanceCriteriaOptions,
|
|
235
|
-
type PlanFieldOptions,
|
|
236
|
-
PlanResultBuilder,
|
|
237
|
-
PublishedResultBuilder,
|
|
238
150
|
} from "./flow.js";
|
|
239
151
|
export { atomicWriteUtf8, hasErrorCode, isEnoent, isPathInside } from "./fs-utils.js";
|
|
240
152
|
export {
|
|
241
|
-
type AcceptedReviewHandoffActionSpec,
|
|
242
153
|
acceptedReviewHandoffAction,
|
|
243
|
-
type QueuedInstructionActionSpec,
|
|
244
|
-
queuedInstructionAction,
|
|
245
|
-
type RevisionActionSpec,
|
|
246
154
|
revisionAction,
|
|
247
155
|
} from "./graph-fragments.js";
|
|
248
156
|
export {
|
|
249
|
-
type CapabilityAccessor,
|
|
250
157
|
createCapabilityAccessor,
|
|
251
158
|
type ProvidedCapability,
|
|
252
159
|
} from "./host-capabilities.js";
|
|
253
160
|
export { IntegrationHttpClient, IntegrationHttpError } from "./integration-http.js";
|
|
254
161
|
export { parseJsonData } from "./json-data.js";
|
|
255
162
|
export type {
|
|
256
|
-
LauncherCardMetadata,
|
|
257
163
|
LauncherFieldDefinition,
|
|
258
164
|
LauncherFieldOptionDefinition,
|
|
259
|
-
LauncherSchemaDefinition,
|
|
260
165
|
LauncherValidationError,
|
|
261
|
-
UiLauncherSummaryBase,
|
|
262
166
|
} from "./launcher-contract.js";
|
|
263
167
|
export {
|
|
264
168
|
normalizeLeafOutcomeCaptureResult,
|
|
265
169
|
validateLeafOutcomeCaptureResult,
|
|
266
|
-
validateProcessLeafOutcomeDefinition,
|
|
267
170
|
} from "./leaf-outcomes.js";
|
|
268
171
|
export {
|
|
269
|
-
type BuiltinPiProviderReference,
|
|
270
172
|
builtinPiProvider,
|
|
271
|
-
type ConfiguredPiProviderReference,
|
|
272
173
|
type ConfiguredProviderModel,
|
|
273
174
|
configuredPiProvider,
|
|
274
175
|
credentialBasedModelStatuses,
|
|
@@ -280,62 +181,32 @@ export {
|
|
|
280
181
|
defineWorkerConfig,
|
|
281
182
|
type ErasedModelProviderDefinition,
|
|
282
183
|
filterProviderOptionsForDefinition,
|
|
283
|
-
type ModelProviderCredentialDefinition,
|
|
284
184
|
type ModelProviderDefinition,
|
|
285
185
|
type ModelProviderModelsContext,
|
|
286
|
-
type ModelProviderSecretsContext,
|
|
287
|
-
type ModelProviderServer,
|
|
288
186
|
type ModelProviderSet,
|
|
289
187
|
type ModelProviderSetEntry,
|
|
290
188
|
type ModelProviderWorker,
|
|
291
|
-
type ParsedModelProviderConfig,
|
|
292
189
|
type PiServerAdapter,
|
|
293
|
-
type PiServerGenerateTextInput,
|
|
294
|
-
type PiServerReference,
|
|
295
|
-
type PiWorkerContribution,
|
|
296
|
-
type PiWorkerContributionContext,
|
|
297
|
-
type PiWorkerReference,
|
|
298
|
-
type PiWorkerSecretBag,
|
|
299
190
|
type ProviderAvailability,
|
|
300
191
|
type ProviderCredentialStatus,
|
|
301
192
|
type ProviderJsonObject,
|
|
302
|
-
type ProviderJsonPrimitive,
|
|
303
|
-
type ProviderJsonValue,
|
|
304
193
|
type ProviderModelStatus,
|
|
305
194
|
type ProviderOptionChoice,
|
|
306
|
-
type ProviderOptionChoicesContext,
|
|
307
|
-
type ProviderOptionDefaultContext,
|
|
308
|
-
type ProviderOptionField,
|
|
309
|
-
type ProviderOptionsDefinition,
|
|
310
195
|
type ProviderOptionsResolution,
|
|
311
|
-
type ProviderOptionsResolutionInput,
|
|
312
196
|
type ProviderOptionValidationIssue,
|
|
313
|
-
type ProviderWorkerConfigContext,
|
|
314
|
-
type ProviderWorkerConfigDefinition,
|
|
315
|
-
type ProviderWorkerConfigSchema,
|
|
316
197
|
piServer,
|
|
317
198
|
piWorker,
|
|
318
199
|
resolveProviderOptions,
|
|
319
200
|
} from "./model-provider.js";
|
|
201
|
+
export { buildProcessFlowView } from "./process-flow-view.js";
|
|
320
202
|
export {
|
|
321
|
-
collectProcessAvailableToolNames,
|
|
322
|
-
resolveTurnActiveToolNames,
|
|
323
|
-
resolveTurnAvailableToolNames,
|
|
324
|
-
validatePiBuiltInToolArray,
|
|
325
|
-
} from "./pi-config.js";
|
|
326
|
-
export { buildProcessFlowView, collapseRoutingTurns } from "./process-flow-view.js";
|
|
327
|
-
export {
|
|
328
|
-
getAllProcessGraphs,
|
|
329
203
|
getProcessGraph,
|
|
330
204
|
getProcessTurnGraph,
|
|
331
|
-
getReachableTurnIdsForProcessGraph,
|
|
332
205
|
getTurnTransitionsForProcessGraph,
|
|
333
206
|
hasProcessGraph,
|
|
334
207
|
isTurnAvailableForProcessGraph,
|
|
335
208
|
listLlmTurnIdsForProcessGraph,
|
|
336
209
|
type ProcessGraphRegistry,
|
|
337
|
-
type ProcessGraphSource,
|
|
338
|
-
type ProcessGraphTurnView,
|
|
339
210
|
type ProcessGraphView,
|
|
340
211
|
serializeProcessGraph,
|
|
341
212
|
toProcessGraphView,
|
|
@@ -344,12 +215,10 @@ export {
|
|
|
344
215
|
validateProcessGraphTurnTransitions,
|
|
345
216
|
} from "./process-graph.js";
|
|
346
217
|
export {
|
|
347
|
-
type BuiltProcessLauncherDefinition,
|
|
348
218
|
buildProcessLaunchers,
|
|
349
219
|
createProcessLauncherBuilder,
|
|
350
220
|
} from "./process-launcher-builder.js";
|
|
351
221
|
export {
|
|
352
|
-
type BuiltProcessWatcherDefinition,
|
|
353
222
|
buildProcessWatchers,
|
|
354
223
|
createProcessWatcherBuilder,
|
|
355
224
|
} from "./process-watcher-builder.js";
|
|
@@ -382,38 +251,26 @@ export {
|
|
|
382
251
|
presentRepositoryIssueWatcherConfig,
|
|
383
252
|
type RepositoryIssueWatcherConfig,
|
|
384
253
|
} from "./repository-issue-watcher.js";
|
|
254
|
+
export { existingObject, matchesPatch } from "./repository-reconciliation.js";
|
|
255
|
+
export type {
|
|
256
|
+
RepositoryFeedbackSourceConfig,
|
|
257
|
+
RepositoryIssueCancelledSourceConfig,
|
|
258
|
+
RepositoryPullRequestSourceConfig,
|
|
259
|
+
} from "./repository-source-config.js";
|
|
385
260
|
export {
|
|
386
261
|
parseRepositoryFeedbackConfig,
|
|
387
262
|
parseRepositoryIssueCancelledConfig,
|
|
388
263
|
parseRepositoryPullRequestConfig,
|
|
389
264
|
} from "./repository-source-config.js";
|
|
390
265
|
export type { RepositoryIssue, RepositoryPullRequest } from "./repository-types.js";
|
|
391
|
-
export {
|
|
392
|
-
buildPlanSavedEventPayload,
|
|
393
|
-
buildReviewCompletedEventPayload,
|
|
394
|
-
buildReviewRequestedEventPayload,
|
|
395
|
-
filterStringArray,
|
|
396
|
-
} from "./review-flow.js";
|
|
397
266
|
export type {
|
|
398
|
-
LeafOutcomeCapturedEvent,
|
|
399
|
-
PlanApprovedEvent,
|
|
400
|
-
PlanRevisionRequestedEvent,
|
|
401
|
-
ProcessCreatedEvent,
|
|
402
|
-
ProcessUpdatedEvent,
|
|
403
|
-
QuestionRequestedEvent,
|
|
404
|
-
ReviewCompletedEvent,
|
|
405
|
-
ReviewRequestedEvent,
|
|
406
267
|
ServerExtensionEventMap,
|
|
407
268
|
ServerExtensionEventName,
|
|
408
269
|
ServerExtensionEventPayloadInputMap,
|
|
409
|
-
TurnFailedEvent,
|
|
410
|
-
TurnOutcomeEvent,
|
|
411
|
-
TurnStartedEvent,
|
|
412
270
|
} from "./server-events.js";
|
|
413
271
|
export {
|
|
414
272
|
type BuiltServerProcessDefinition,
|
|
415
273
|
createServerProcessBuilder,
|
|
416
|
-
type ServerTurnOutcomeHandler,
|
|
417
274
|
} from "./server-process-builder.js";
|
|
418
275
|
export {
|
|
419
276
|
createEmptyStructuralProcessState,
|
|
@@ -421,58 +278,31 @@ export {
|
|
|
421
278
|
type StructuralProcessState,
|
|
422
279
|
structuralStateCodec,
|
|
423
280
|
} from "./state-helpers.js";
|
|
424
|
-
export {
|
|
425
|
-
type SubprocessEnvInput,
|
|
426
|
-
sanitizeWorkerSubprocessEnv,
|
|
427
|
-
WORKER_SUBPROCESS_SENSITIVE_ENV_KEYS,
|
|
428
|
-
} from "./subprocess-env.js";
|
|
281
|
+
export { sanitizeWorkerSubprocessEnv } from "./subprocess-env.js";
|
|
429
282
|
export { numberArg, objectArg, projectParameters, stringArg } from "./tool-arguments.js";
|
|
430
|
-
export type {
|
|
431
|
-
ToolCallRendererDefinition,
|
|
432
|
-
ToolCallRendererFieldDefinition,
|
|
433
|
-
ToolCallRendererValueKind,
|
|
434
|
-
ToolCallRendererValueSource,
|
|
435
|
-
} from "./tool-renderers.js";
|
|
283
|
+
export type { ToolCallRendererDefinition } from "./tool-renderers.js";
|
|
436
284
|
export {
|
|
437
285
|
CORE_TOOL_CALL_RENDERERS,
|
|
438
|
-
MARKDOWN_RESULT_TOOL_MARKDOWN_PATH,
|
|
439
286
|
MARKDOWN_RESULT_TOOL_NAME,
|
|
440
|
-
MARKDOWN_RESULT_TOOL_RENDERER,
|
|
441
287
|
REQUIRED_MARKDOWN_RESULT_TURN_RESULT,
|
|
442
|
-
TOOL_CALL_RENDERER_VALUE_KINDS,
|
|
443
|
-
TOOL_CALL_RENDERER_VALUE_SOURCES,
|
|
444
288
|
validateToolCallRendererDefinition,
|
|
445
289
|
} from "./tool-renderers.js";
|
|
446
290
|
export {
|
|
447
291
|
assertValidLlmTurnDefinition,
|
|
448
292
|
createRootBranchReviewTurn,
|
|
449
|
-
defaultTurnStartSelection,
|
|
450
293
|
isAutomaticTurnDefinition,
|
|
451
294
|
isExternalTurnDefinition,
|
|
452
295
|
isHumanTurnDefinition,
|
|
453
296
|
isLlmTurnDefinition,
|
|
454
297
|
resolveLlmTurnRestorePrimaryLeafAfterTurn,
|
|
455
|
-
resolveLlmTurnStartSelection,
|
|
456
|
-
validateAutomaticTurnDefinition,
|
|
457
|
-
validateExternalTurnDefinition,
|
|
458
|
-
validateHumanTurnDefinition,
|
|
459
|
-
validateLlmTurnDefinition,
|
|
460
298
|
validateTurnDefinition,
|
|
461
299
|
} from "./turn-semantics.js";
|
|
462
300
|
export type {
|
|
463
301
|
EventBus,
|
|
464
|
-
HumanTurnActionView,
|
|
465
|
-
HumanTurnExternalTrigger,
|
|
466
|
-
HumanTurnNotesField,
|
|
467
|
-
OutcomeToolArrayItemSpec,
|
|
468
|
-
OutcomeToolArrayItemType,
|
|
469
302
|
OutcomeToolParameterSpec,
|
|
470
|
-
OutcomeToolParameterType,
|
|
471
303
|
OutcomeToolSpec,
|
|
472
|
-
PiBuiltInToolName,
|
|
473
304
|
PiCustomMessageInput,
|
|
474
305
|
PiCustomTool,
|
|
475
|
-
PiCustomToolExecutionContext,
|
|
476
306
|
PiEvent,
|
|
477
307
|
PiEventHandler,
|
|
478
308
|
PiEventType,
|
|
@@ -480,7 +310,6 @@ export type {
|
|
|
480
310
|
PiRunDetails,
|
|
481
311
|
PiSessionDiagnostic,
|
|
482
312
|
PiSessionDiagnosticHandler,
|
|
483
|
-
PiSessionDiagnosticLevel,
|
|
484
313
|
PiTerminalAcknowledgementControl,
|
|
485
314
|
PiTerminalAcknowledgementState,
|
|
486
315
|
PiTreeEntry,
|
|
@@ -490,32 +319,15 @@ export type {
|
|
|
490
319
|
PiUsageData,
|
|
491
320
|
ProcessActionPreviewDefinition,
|
|
492
321
|
ProcessActionSchedulingDefinition,
|
|
493
|
-
ProcessActionSchedulingFixedTurnPreview,
|
|
494
|
-
ProcessActionSchedulingPreview,
|
|
495
|
-
ProcessActionSchedulingTriggerPreview,
|
|
496
|
-
ProcessContext,
|
|
497
|
-
ProcessCustomTool,
|
|
498
322
|
ProcessPiConfig,
|
|
499
|
-
ProcessToolResult,
|
|
500
323
|
ResolvedProcessPiConfig,
|
|
501
324
|
TurnAcceptanceState,
|
|
502
|
-
TurnBranchType,
|
|
503
|
-
TurnCompletionMode,
|
|
504
|
-
TurnContextMode,
|
|
505
325
|
TurnOptions,
|
|
506
326
|
TurnResult,
|
|
507
327
|
TurnResultMarkdownBehavior,
|
|
508
|
-
TurnSemanticEntryRefKey,
|
|
509
|
-
} from "./types.js";
|
|
510
|
-
export {
|
|
511
|
-
FRAMEWORK_LLM_TOOL_NAMES,
|
|
512
|
-
PI_BUILT_IN_TOOL_NAMES,
|
|
513
|
-
RESERVED_INTEGRATION_TOOL_NAMES,
|
|
514
|
-
TURN_COMPLETION_MODES,
|
|
515
|
-
TURN_CONTEXT_MODES,
|
|
516
328
|
} from "./types.js";
|
|
329
|
+
export { RESERVED_INTEGRATION_TOOL_NAMES } from "./types.js";
|
|
517
330
|
export {
|
|
518
|
-
type BuiltUiProcessDefinition,
|
|
519
331
|
buildUiProcessDefinition,
|
|
520
332
|
createUiProcessBuilder,
|
|
521
333
|
} from "./ui-process-builder.js";
|
package/src/integration-http.ts
CHANGED
|
@@ -1,6 +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
|
+
/** @public */
|
|
3
4
|
constructor(
|
|
5
|
+
/** @public */
|
|
4
6
|
readonly status: number,
|
|
5
7
|
message: string,
|
|
6
8
|
) {
|
|
@@ -8,15 +10,22 @@ export class IntegrationHttpError extends Error {
|
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
/** Shared transport; extensions own endpoint paths, credentials, and response types. */
|
|
13
|
+
/** Shared transport; extensions own endpoint paths, credentials, and response types. @public */
|
|
12
14
|
export class IntegrationHttpClient {
|
|
15
|
+
/** @internal */
|
|
13
16
|
constructor(
|
|
14
17
|
private readonly provider: string,
|
|
15
18
|
private readonly baseUrl: string,
|
|
16
19
|
private readonly headers: Record<string, string>,
|
|
17
|
-
private readonly pagination = {
|
|
20
|
+
private readonly pagination = {
|
|
21
|
+
/** @internal */
|
|
22
|
+
key: "per_page",
|
|
23
|
+
/** @internal */
|
|
24
|
+
size: 100,
|
|
25
|
+
},
|
|
18
26
|
) {}
|
|
19
27
|
|
|
28
|
+
/** @internal */
|
|
20
29
|
protected async response(path: string, init: RequestInit = {}): Promise<Response> {
|
|
21
30
|
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
22
31
|
...init,
|
|
@@ -34,15 +43,18 @@ export class IntegrationHttpClient {
|
|
|
34
43
|
return response;
|
|
35
44
|
}
|
|
36
45
|
|
|
46
|
+
/** @internal */
|
|
37
47
|
protected async request<T>(path: string, init: RequestInit = {}): Promise<T> {
|
|
38
48
|
const response = await this.response(path, init);
|
|
39
49
|
return response.status === 204 ? (undefined as T) : response.json();
|
|
40
50
|
}
|
|
41
51
|
|
|
52
|
+
/** @internal */
|
|
42
53
|
protected writeJson<T>(path: string, method: string, body: unknown, signal?: AbortSignal) {
|
|
43
54
|
return this.request<T>(path, { method, body: JSON.stringify(body), signal });
|
|
44
55
|
}
|
|
45
56
|
|
|
57
|
+
/** @internal */
|
|
46
58
|
protected async pages<T>(path: string, signal?: AbortSignal): Promise<T[]> {
|
|
47
59
|
const items: T[] = [];
|
|
48
60
|
const { key, size } = this.pagination;
|