@leitwerk-dev/process-sdk 0.2.0 → 0.2.1
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/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 +336 -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-B4gG5w1K.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 +8 -1
- 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 +24 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +262 -80
- 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 +20 -2
- 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 +21 -1
- 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 +27 -1
- 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 +396 -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 +15 -3
- 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 +5 -201
- 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 +30 -4
- 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 +35 -5
- package/src/repository-reconciliation.ts +30 -0
- package/src/repository-source-config.ts +20 -1
- 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,26 +116,18 @@ 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,
|
|
@@ -202,73 +136,37 @@ export { findUiLauncherById, SafeLaunchPreparationError } from "./extension-api.
|
|
|
202
136
|
export { defineExternalActionSource } from "./external-action-source.js";
|
|
203
137
|
export { createExternalSourcePollReporter } from "./external-source-poll.js";
|
|
204
138
|
export {
|
|
205
|
-
AutomaticFlowBuilder,
|
|
206
139
|
AutomaticOutcomeBuilder,
|
|
207
|
-
createFlowAutomaticRunContext,
|
|
208
140
|
createFlowPromptContext,
|
|
209
|
-
DEFAULT_FLOW_PRODUCT_NAME,
|
|
210
|
-
DEFAULT_PLAN_RESULT_OUTCOME_ID,
|
|
211
|
-
ExternalActionBuilder,
|
|
212
|
-
ExternalFlowBuilder,
|
|
213
|
-
ExternalRouteBuilder,
|
|
214
|
-
type FlowAutomaticOutcomeEffectContext,
|
|
215
141
|
type FlowAutomaticRunContext,
|
|
216
|
-
type FlowAutomaticTurn,
|
|
217
|
-
type FlowExternalTurn,
|
|
218
142
|
FlowFragmentBuilder,
|
|
219
|
-
type FlowHumanTurn,
|
|
220
|
-
type FlowLlmOutcomeEffectContext,
|
|
221
143
|
type FlowLlmPreparationContext,
|
|
222
|
-
type FlowLlmTurn,
|
|
223
|
-
FlowProcessBuilder,
|
|
224
144
|
type FlowPromptContext,
|
|
225
|
-
type FlowRepoContext,
|
|
226
|
-
type FlowRepoLookup,
|
|
227
|
-
type FlowTurn,
|
|
228
145
|
flow,
|
|
229
|
-
HumanActionBuilder,
|
|
230
146
|
HumanFlowBuilder,
|
|
231
|
-
LlmFlowBuilder,
|
|
232
|
-
LlmTurnEndBuilder,
|
|
233
|
-
OutcomeToolBuilder,
|
|
234
|
-
type PlanAcceptanceCriteriaOptions,
|
|
235
|
-
type PlanFieldOptions,
|
|
236
|
-
PlanResultBuilder,
|
|
237
|
-
PublishedResultBuilder,
|
|
238
147
|
} from "./flow.js";
|
|
239
148
|
export { atomicWriteUtf8, hasErrorCode, isEnoent, isPathInside } from "./fs-utils.js";
|
|
240
149
|
export {
|
|
241
|
-
type AcceptedReviewHandoffActionSpec,
|
|
242
150
|
acceptedReviewHandoffAction,
|
|
243
|
-
type QueuedInstructionActionSpec,
|
|
244
|
-
queuedInstructionAction,
|
|
245
|
-
type RevisionActionSpec,
|
|
246
151
|
revisionAction,
|
|
247
152
|
} from "./graph-fragments.js";
|
|
248
153
|
export {
|
|
249
|
-
type CapabilityAccessor,
|
|
250
154
|
createCapabilityAccessor,
|
|
251
155
|
type ProvidedCapability,
|
|
252
156
|
} from "./host-capabilities.js";
|
|
253
157
|
export { IntegrationHttpClient, IntegrationHttpError } from "./integration-http.js";
|
|
254
158
|
export { parseJsonData } from "./json-data.js";
|
|
255
159
|
export type {
|
|
256
|
-
LauncherCardMetadata,
|
|
257
160
|
LauncherFieldDefinition,
|
|
258
161
|
LauncherFieldOptionDefinition,
|
|
259
|
-
LauncherSchemaDefinition,
|
|
260
162
|
LauncherValidationError,
|
|
261
|
-
UiLauncherSummaryBase,
|
|
262
163
|
} from "./launcher-contract.js";
|
|
263
164
|
export {
|
|
264
165
|
normalizeLeafOutcomeCaptureResult,
|
|
265
166
|
validateLeafOutcomeCaptureResult,
|
|
266
|
-
validateProcessLeafOutcomeDefinition,
|
|
267
167
|
} from "./leaf-outcomes.js";
|
|
268
168
|
export {
|
|
269
|
-
type BuiltinPiProviderReference,
|
|
270
169
|
builtinPiProvider,
|
|
271
|
-
type ConfiguredPiProviderReference,
|
|
272
170
|
type ConfiguredProviderModel,
|
|
273
171
|
configuredPiProvider,
|
|
274
172
|
credentialBasedModelStatuses,
|
|
@@ -280,62 +178,32 @@ export {
|
|
|
280
178
|
defineWorkerConfig,
|
|
281
179
|
type ErasedModelProviderDefinition,
|
|
282
180
|
filterProviderOptionsForDefinition,
|
|
283
|
-
type ModelProviderCredentialDefinition,
|
|
284
181
|
type ModelProviderDefinition,
|
|
285
182
|
type ModelProviderModelsContext,
|
|
286
|
-
type ModelProviderSecretsContext,
|
|
287
|
-
type ModelProviderServer,
|
|
288
183
|
type ModelProviderSet,
|
|
289
184
|
type ModelProviderSetEntry,
|
|
290
185
|
type ModelProviderWorker,
|
|
291
|
-
type ParsedModelProviderConfig,
|
|
292
186
|
type PiServerAdapter,
|
|
293
|
-
type PiServerGenerateTextInput,
|
|
294
|
-
type PiServerReference,
|
|
295
|
-
type PiWorkerContribution,
|
|
296
|
-
type PiWorkerContributionContext,
|
|
297
|
-
type PiWorkerReference,
|
|
298
|
-
type PiWorkerSecretBag,
|
|
299
187
|
type ProviderAvailability,
|
|
300
188
|
type ProviderCredentialStatus,
|
|
301
189
|
type ProviderJsonObject,
|
|
302
|
-
type ProviderJsonPrimitive,
|
|
303
|
-
type ProviderJsonValue,
|
|
304
190
|
type ProviderModelStatus,
|
|
305
191
|
type ProviderOptionChoice,
|
|
306
|
-
type ProviderOptionChoicesContext,
|
|
307
|
-
type ProviderOptionDefaultContext,
|
|
308
|
-
type ProviderOptionField,
|
|
309
|
-
type ProviderOptionsDefinition,
|
|
310
192
|
type ProviderOptionsResolution,
|
|
311
|
-
type ProviderOptionsResolutionInput,
|
|
312
193
|
type ProviderOptionValidationIssue,
|
|
313
|
-
type ProviderWorkerConfigContext,
|
|
314
|
-
type ProviderWorkerConfigDefinition,
|
|
315
|
-
type ProviderWorkerConfigSchema,
|
|
316
194
|
piServer,
|
|
317
195
|
piWorker,
|
|
318
196
|
resolveProviderOptions,
|
|
319
197
|
} from "./model-provider.js";
|
|
198
|
+
export { buildProcessFlowView } from "./process-flow-view.js";
|
|
320
199
|
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
200
|
getProcessGraph,
|
|
330
201
|
getProcessTurnGraph,
|
|
331
|
-
getReachableTurnIdsForProcessGraph,
|
|
332
202
|
getTurnTransitionsForProcessGraph,
|
|
333
203
|
hasProcessGraph,
|
|
334
204
|
isTurnAvailableForProcessGraph,
|
|
335
205
|
listLlmTurnIdsForProcessGraph,
|
|
336
206
|
type ProcessGraphRegistry,
|
|
337
|
-
type ProcessGraphSource,
|
|
338
|
-
type ProcessGraphTurnView,
|
|
339
207
|
type ProcessGraphView,
|
|
340
208
|
serializeProcessGraph,
|
|
341
209
|
toProcessGraphView,
|
|
@@ -344,12 +212,10 @@ export {
|
|
|
344
212
|
validateProcessGraphTurnTransitions,
|
|
345
213
|
} from "./process-graph.js";
|
|
346
214
|
export {
|
|
347
|
-
type BuiltProcessLauncherDefinition,
|
|
348
215
|
buildProcessLaunchers,
|
|
349
216
|
createProcessLauncherBuilder,
|
|
350
217
|
} from "./process-launcher-builder.js";
|
|
351
218
|
export {
|
|
352
|
-
type BuiltProcessWatcherDefinition,
|
|
353
219
|
buildProcessWatchers,
|
|
354
220
|
createProcessWatcherBuilder,
|
|
355
221
|
} from "./process-watcher-builder.js";
|
|
@@ -382,38 +248,21 @@ export {
|
|
|
382
248
|
presentRepositoryIssueWatcherConfig,
|
|
383
249
|
type RepositoryIssueWatcherConfig,
|
|
384
250
|
} from "./repository-issue-watcher.js";
|
|
251
|
+
export { existingObject, matchesPatch } from "./repository-reconciliation.js";
|
|
385
252
|
export {
|
|
386
253
|
parseRepositoryFeedbackConfig,
|
|
387
254
|
parseRepositoryIssueCancelledConfig,
|
|
388
255
|
parseRepositoryPullRequestConfig,
|
|
389
256
|
} from "./repository-source-config.js";
|
|
390
257
|
export type { RepositoryIssue, RepositoryPullRequest } from "./repository-types.js";
|
|
391
|
-
export {
|
|
392
|
-
buildPlanSavedEventPayload,
|
|
393
|
-
buildReviewCompletedEventPayload,
|
|
394
|
-
buildReviewRequestedEventPayload,
|
|
395
|
-
filterStringArray,
|
|
396
|
-
} from "./review-flow.js";
|
|
397
258
|
export type {
|
|
398
|
-
LeafOutcomeCapturedEvent,
|
|
399
|
-
PlanApprovedEvent,
|
|
400
|
-
PlanRevisionRequestedEvent,
|
|
401
|
-
ProcessCreatedEvent,
|
|
402
|
-
ProcessUpdatedEvent,
|
|
403
|
-
QuestionRequestedEvent,
|
|
404
|
-
ReviewCompletedEvent,
|
|
405
|
-
ReviewRequestedEvent,
|
|
406
259
|
ServerExtensionEventMap,
|
|
407
260
|
ServerExtensionEventName,
|
|
408
261
|
ServerExtensionEventPayloadInputMap,
|
|
409
|
-
TurnFailedEvent,
|
|
410
|
-
TurnOutcomeEvent,
|
|
411
|
-
TurnStartedEvent,
|
|
412
262
|
} from "./server-events.js";
|
|
413
263
|
export {
|
|
414
264
|
type BuiltServerProcessDefinition,
|
|
415
265
|
createServerProcessBuilder,
|
|
416
|
-
type ServerTurnOutcomeHandler,
|
|
417
266
|
} from "./server-process-builder.js";
|
|
418
267
|
export {
|
|
419
268
|
createEmptyStructuralProcessState,
|
|
@@ -421,58 +270,31 @@ export {
|
|
|
421
270
|
type StructuralProcessState,
|
|
422
271
|
structuralStateCodec,
|
|
423
272
|
} from "./state-helpers.js";
|
|
424
|
-
export {
|
|
425
|
-
type SubprocessEnvInput,
|
|
426
|
-
sanitizeWorkerSubprocessEnv,
|
|
427
|
-
WORKER_SUBPROCESS_SENSITIVE_ENV_KEYS,
|
|
428
|
-
} from "./subprocess-env.js";
|
|
273
|
+
export { sanitizeWorkerSubprocessEnv } from "./subprocess-env.js";
|
|
429
274
|
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";
|
|
275
|
+
export type { ToolCallRendererDefinition } from "./tool-renderers.js";
|
|
436
276
|
export {
|
|
437
277
|
CORE_TOOL_CALL_RENDERERS,
|
|
438
|
-
MARKDOWN_RESULT_TOOL_MARKDOWN_PATH,
|
|
439
278
|
MARKDOWN_RESULT_TOOL_NAME,
|
|
440
|
-
MARKDOWN_RESULT_TOOL_RENDERER,
|
|
441
279
|
REQUIRED_MARKDOWN_RESULT_TURN_RESULT,
|
|
442
|
-
TOOL_CALL_RENDERER_VALUE_KINDS,
|
|
443
|
-
TOOL_CALL_RENDERER_VALUE_SOURCES,
|
|
444
280
|
validateToolCallRendererDefinition,
|
|
445
281
|
} from "./tool-renderers.js";
|
|
446
282
|
export {
|
|
447
283
|
assertValidLlmTurnDefinition,
|
|
448
284
|
createRootBranchReviewTurn,
|
|
449
|
-
defaultTurnStartSelection,
|
|
450
285
|
isAutomaticTurnDefinition,
|
|
451
286
|
isExternalTurnDefinition,
|
|
452
287
|
isHumanTurnDefinition,
|
|
453
288
|
isLlmTurnDefinition,
|
|
454
289
|
resolveLlmTurnRestorePrimaryLeafAfterTurn,
|
|
455
|
-
resolveLlmTurnStartSelection,
|
|
456
|
-
validateAutomaticTurnDefinition,
|
|
457
|
-
validateExternalTurnDefinition,
|
|
458
|
-
validateHumanTurnDefinition,
|
|
459
|
-
validateLlmTurnDefinition,
|
|
460
290
|
validateTurnDefinition,
|
|
461
291
|
} from "./turn-semantics.js";
|
|
462
292
|
export type {
|
|
463
293
|
EventBus,
|
|
464
|
-
HumanTurnActionView,
|
|
465
|
-
HumanTurnExternalTrigger,
|
|
466
|
-
HumanTurnNotesField,
|
|
467
|
-
OutcomeToolArrayItemSpec,
|
|
468
|
-
OutcomeToolArrayItemType,
|
|
469
294
|
OutcomeToolParameterSpec,
|
|
470
|
-
OutcomeToolParameterType,
|
|
471
295
|
OutcomeToolSpec,
|
|
472
|
-
PiBuiltInToolName,
|
|
473
296
|
PiCustomMessageInput,
|
|
474
297
|
PiCustomTool,
|
|
475
|
-
PiCustomToolExecutionContext,
|
|
476
298
|
PiEvent,
|
|
477
299
|
PiEventHandler,
|
|
478
300
|
PiEventType,
|
|
@@ -480,7 +302,6 @@ export type {
|
|
|
480
302
|
PiRunDetails,
|
|
481
303
|
PiSessionDiagnostic,
|
|
482
304
|
PiSessionDiagnosticHandler,
|
|
483
|
-
PiSessionDiagnosticLevel,
|
|
484
305
|
PiTerminalAcknowledgementControl,
|
|
485
306
|
PiTerminalAcknowledgementState,
|
|
486
307
|
PiTreeEntry,
|
|
@@ -490,32 +311,15 @@ export type {
|
|
|
490
311
|
PiUsageData,
|
|
491
312
|
ProcessActionPreviewDefinition,
|
|
492
313
|
ProcessActionSchedulingDefinition,
|
|
493
|
-
ProcessActionSchedulingFixedTurnPreview,
|
|
494
|
-
ProcessActionSchedulingPreview,
|
|
495
|
-
ProcessActionSchedulingTriggerPreview,
|
|
496
|
-
ProcessContext,
|
|
497
|
-
ProcessCustomTool,
|
|
498
314
|
ProcessPiConfig,
|
|
499
|
-
ProcessToolResult,
|
|
500
315
|
ResolvedProcessPiConfig,
|
|
501
316
|
TurnAcceptanceState,
|
|
502
|
-
TurnBranchType,
|
|
503
|
-
TurnCompletionMode,
|
|
504
|
-
TurnContextMode,
|
|
505
317
|
TurnOptions,
|
|
506
318
|
TurnResult,
|
|
507
319
|
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
320
|
} from "./types.js";
|
|
321
|
+
export { RESERVED_INTEGRATION_TOOL_NAMES } from "./types.js";
|
|
517
322
|
export {
|
|
518
|
-
type BuiltUiProcessDefinition,
|
|
519
323
|
buildUiProcessDefinition,
|
|
520
324
|
createUiProcessBuilder,
|
|
521
325
|
} 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. @internal */
|
|
2
2
|
export class IntegrationHttpError extends Error {
|
|
3
|
+
/** @internal */
|
|
3
4
|
constructor(
|
|
5
|
+
/** @internal */
|
|
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;
|
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. @internal */
|
|
2
2
|
export function parseJsonData(
|
|
3
3
|
value: unknown,
|
|
4
4
|
message = "Value must be JSON-serializable",
|