@lucern/sdk 1.0.29 → 1.0.31
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/CHANGELOG.md +12 -0
- package/dist/accessControl.d.ts +31 -31
- package/dist/accessControl.js +1 -0
- package/dist/adminClient.d.ts +74 -74
- package/dist/adminClient.js +38 -30
- package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
- package/dist/{answersClient.js → answers-client.js} +2 -2
- package/dist/audience/index.d.ts +12 -12
- package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
- package/dist/audiences-client.js +107 -0
- package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
- package/dist/{auditClient.js → audit-client.js} +8 -7
- package/dist/authContext.d.ts +26 -26
- package/dist/authDeviceClient.d.ts +11 -11
- package/dist/authDeviceClient.js +4 -6
- package/dist/beliefs/index.d.ts +56 -28
- package/dist/beliefs/index.js +2 -1
- package/dist/beliefsClient.d.ts +71 -63
- package/dist/beliefsClient.js +90 -67
- package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
- package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
- package/dist/client-assembly-types.d.ts +219 -0
- package/dist/client-assembly-types.js +2 -0
- package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
- package/dist/client-config.js +2 -0
- package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
- package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
- package/dist/client.d.ts +1906 -352
- package/dist/client.js +34 -30
- package/dist/clientGraphNamespaces.d.ts +35 -25
- package/dist/clientGraphNamespaces.js +11 -5
- package/dist/clientHelpers.js +8 -5
- package/dist/clientKnowledgeNamespaces.d.ts +124 -84
- package/dist/clientKnowledgeNamespaces.js +35 -34
- package/dist/clientLocalHelpers.d.ts +81 -52
- package/dist/clientLocalHelpers.js +193 -43
- package/dist/clientPlatformNamespaces.d.ts +1541 -150
- package/dist/clientPlatformNamespaces.js +10 -5
- package/dist/clientRuntime.d.ts +1 -1
- package/dist/clientRuntime.js +1 -1
- package/dist/clientWorkflowNamespaces.d.ts +211 -97
- package/dist/clientWorkflowNamespaces.js +22 -19
- package/dist/contextClient.d.ts +2 -2
- package/dist/contextClient.js +79 -50
- package/dist/contextFacade.d.ts +1 -1
- package/dist/contextFacade.js +2 -0
- package/dist/contextPackCompiler.d.ts +52 -52
- package/dist/contextPackCompiler.js +192 -122
- package/dist/contextPackPolicy.d.ts +22 -22
- package/dist/contextPackPolicy.js +21 -9
- package/dist/contextPackSchema.d.ts +3 -3
- package/dist/contextPackSchema.js +1 -0
- package/dist/contextTypes.d.ts +155 -155
- package/dist/contracts/api-enums.contract.js +2 -11
- package/dist/contracts/auth-session.contract.d.ts +16 -16
- package/dist/contracts/auth-session.contract.js +3 -2
- package/dist/contracts/context-pack.contract.d.ts +216 -216
- package/dist/contracts/contextPack.js +2 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +2 -1
- package/dist/contracts/lens-filter.contract.d.ts +8 -8
- package/dist/contracts/lens-filter.contract.js +10 -10
- package/dist/contracts/lens-workflow.contract.d.ts +32 -32
- package/dist/contracts/lens-workflow.contract.js +2 -1
- package/dist/contracts/lensFilter.js +2 -0
- package/dist/contracts/lensWorkflow.js +2 -0
- package/dist/contracts/mcpTools.d.ts +19 -19
- package/dist/contracts/mcpTools.js +3 -1
- package/dist/contracts/prompt.contract.d.ts +12 -12
- package/dist/contracts/prompt.js +1 -0
- package/dist/contracts/sdk-tools.contract.js +1 -0
- package/dist/contracts/sdkTools.js +2 -0
- package/dist/contracts/tool-contracts.js +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
- package/dist/contracts/workflow-runtime.contract.js +1 -5
- package/dist/contracts/workflowRuntime.js +2 -0
- package/dist/contradictions/index.d.ts +8 -8
- package/dist/contradictions/index.js +1 -0
- package/dist/control-plane.d.ts +10 -10
- package/dist/control-plane.js +2 -2
- package/dist/controlObjectOwnership.d.ts +11 -11
- package/dist/controlObjectOwnership.js +1 -0
- package/dist/coreClient.d.ts +51 -51
- package/dist/coreClient.js +269 -101
- package/dist/customTools.d.ts +19 -19
- package/dist/customTools.js +4 -2
- package/dist/decisions/index.d.ts +18 -18
- package/dist/decisions/index.js +1 -0
- package/dist/decisionsClient.d.ts +4 -4
- package/dist/decisionsClient.js +36 -27
- package/dist/edges/index.d.ts +20 -18
- package/dist/edges/index.js +1 -0
- package/dist/embeddingsClient.d.ts +29 -29
- package/dist/embeddingsClient.js +15 -8
- package/dist/eventingClient.d.ts +27 -27
- package/dist/eventingClient.js +10 -5
- package/dist/events.d.ts +83 -83
- package/dist/events.js +19 -15
- package/dist/eventsCore.d.ts +7 -7
- package/dist/eventsCore.js +11 -10
- package/dist/evidence/index.d.ts +23 -21
- package/dist/evidence/index.js +1 -0
- package/dist/evidenceClient.d.ts +23 -23
- package/dist/evidenceClient.js +10 -6
- package/dist/facade/context.d.ts +9 -9
- package/dist/facade/context.js +67 -41
- package/dist/functionSurface.js +2 -0
- package/dist/functionSurfaceClient.js +2 -0
- package/dist/gatewayFacades.d.ts +215 -215
- package/dist/gatewayFacades.factories.d.ts +23 -44
- package/dist/gatewayFacades.factories.js +63 -62
- package/dist/gatewayFacades.js +31 -32
- package/dist/graphAnalysisClient.d.ts +60 -60
- package/dist/graphAnalysisClient.js +19 -18
- package/dist/graphClient.d.ts +34 -34
- package/dist/graphClient.js +56 -35
- package/dist/graphIntel.js +2 -0
- package/dist/graphIntelligence.d.ts +2 -2
- package/dist/graphIntelligence.js +1 -1
- package/dist/graphRecommendationsClient.d.ts +24 -24
- package/dist/graphRecommendationsClient.js +12 -7
- package/dist/graphStateClassifierClient.d.ts +13 -13
- package/dist/graphStateClassifierClient.js +10 -5
- package/dist/harnessClient.d.ts +61 -61
- package/dist/harnessClient.js +44 -31
- package/dist/identityClient.d.ts +33 -59
- package/dist/identityClient.js +126 -98
- package/dist/index.d.ts +20 -20
- package/dist/index.js +20 -19
- package/dist/infisicalRuntime.d.ts +11 -11
- package/dist/infisicalRuntime.js +20 -14
- package/dist/jobsClient.d.ts +28 -28
- package/dist/jobsClient.js +6 -3
- package/dist/learningClient.js +13 -8
- package/dist/lenses/index.d.ts +124 -28
- package/dist/lenses/index.js +1 -0
- package/dist/mcpClient.d.ts +1 -1
- package/dist/mcpClient.js +3 -3
- package/dist/modelRuntimeClient.d.ts +27 -27
- package/dist/modelRuntimeClient.js +10 -5
- package/dist/nodes/index.d.ts +9 -9
- package/dist/nodes/index.js +1 -0
- package/dist/ontologies/index.d.ts +68 -22
- package/dist/ontologies/index.js +1 -0
- package/dist/ontologyClient.js +24 -17
- package/dist/ontologyLinksClient.d.ts +35 -35
- package/dist/ontologyLinksClient.js +9 -6
- package/dist/opinion.d.ts +3 -3
- package/dist/opinion.js +12 -5
- package/dist/orgGraphSearchClient.d.ts +39 -39
- package/dist/orgGraphSearchClient.js +22 -13
- package/dist/packsClient.d.ts +1 -1
- package/dist/packsClient.js +28 -19
- package/dist/policyClient.d.ts +79 -68
- package/dist/policyClient.js +18 -12
- package/dist/proof-attestation.json +1 -1
- package/dist/questions/index.d.ts +38 -27
- package/dist/questions/index.js +1 -0
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -0
- package/dist/realtime/refs.d.ts +2 -2
- package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
- package/dist/{reportsClient.js → reports-client.js} +19 -13
- package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
- package/dist/{schemaClient.js → schema-client.js} +14 -11
- package/dist/sdkSurface.d.ts +12 -12
- package/dist/sdkSurface.js +14 -10
- package/dist/secrets.d.ts +1 -1
- package/dist/secrets.js +2 -1
- package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
- package/dist/{sourcesClient.js → sources-client.js} +4 -5
- package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
- package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
- package/dist/toolRegistryClient.d.ts +46 -46
- package/dist/toolRegistryClient.js +22 -11
- package/dist/topics/index.d.ts +23 -23
- package/dist/topics/index.js +2 -1
- package/dist/topicsClient.d.ts +6 -6
- package/dist/topicsClient.js +29 -18
- package/dist/types.d.ts +356 -355
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflowClient.d.ts +36 -35
- package/dist/workflowClient.js +88 -60
- package/dist/worktrees/index.d.ts +118 -32
- package/dist/worktrees/index.js +2 -1
- package/package.json +45 -5
- package/dist/audiencesClient.js +0 -115
- package/dist/clientAssemblyTypes.d.ts +0 -33
- package/dist/clientAssemblyTypes.js +0 -2
- package/dist/clientConfig.js +0 -2
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/workflowClient.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { LensPerspectiveType, LensPromptTemplateReference, LensStatus, LensTaskTemplate, LensWorkflowTemplate } from "./contracts/lensWorkflow";
|
|
1
|
+
import type { LensPerspectiveType, LensPromptTemplateReference, LensQuestionTemplate, LensStatus, LensTaskTemplate, LensWorkflowTemplate } from "./contracts/lensWorkflow";
|
|
3
2
|
import type { WorkflowAutoFixPolicy, WorkflowProofArtifact, WorkflowStaffingHint } from "./contracts/workflowRuntime";
|
|
3
|
+
import { type GatewayClientConfig } from "./coreClient";
|
|
4
4
|
import type { CompleteTaskResponse, CreateTaskResponse, JsonObject, ListTopicsResponse, ListWorktreesResponse, MergeWorktreeResponse, OpenPullRequestResponse, PushWorktreeResponse, SwitchTopicContextResponse, TopicIdentifierInput, UpdateTaskResponse, WorkflowBranchRecord, WorkflowLensRecord, WorkflowWorktreeRecord } from "./types";
|
|
5
|
-
export { LucernApiError };
|
|
6
5
|
export type { PlatformGatewaySuccess } from "./coreClient";
|
|
6
|
+
export { LucernApiError } from "./coreClient";
|
|
7
7
|
export type { AddWorktreeResponse, CompleteTaskResponse, CreateBranchResponse, CreateLensResponse, CreateTaskResponse, LensTopicBindingResponse, ListBranchesResponse, ListLensesResponse, ListTopicsResponse, ListWorktreesResponse, MergeWorktreeResponse, OpenPullRequestResponse, PushWorktreeResponse, SwitchTopicContextResponse, UpdateTaskResponse, } from "./types";
|
|
8
8
|
/** Configuration for the workflow client. */
|
|
9
9
|
export type WorkflowClientConfig = GatewayClientConfig;
|
|
@@ -83,52 +83,52 @@ export type WorkflowMergeInputOutcome = string | {
|
|
|
83
83
|
rationale: string;
|
|
84
84
|
};
|
|
85
85
|
/** Input for merging worktree findings with optional belief confidence outcomes. */
|
|
86
|
-
export
|
|
86
|
+
export interface MergeInput {
|
|
87
87
|
outcomes: WorkflowMergeInputOutcome[];
|
|
88
88
|
summary?: string;
|
|
89
|
-
}
|
|
89
|
+
}
|
|
90
90
|
/** Input for updating the beliefs and questions tracked by a worktree. */
|
|
91
|
-
export
|
|
92
|
-
worktreeId: string;
|
|
91
|
+
export interface UpdateWorktreeTargetsInput {
|
|
93
92
|
addBeliefIds?: string[];
|
|
94
93
|
addQuestionIds?: string[];
|
|
95
94
|
removeBeliefIds?: string[];
|
|
96
95
|
removeQuestionIds?: string[];
|
|
97
|
-
};
|
|
98
|
-
/** Input for marking a worktree complete with recorded outcomes. */
|
|
99
|
-
export type CompleteWorktreeInput = {
|
|
100
96
|
worktreeId: string;
|
|
101
|
-
|
|
97
|
+
}
|
|
98
|
+
/** Input for marking a worktree complete with recorded outcomes. */
|
|
99
|
+
export interface CompleteWorktreeInput {
|
|
102
100
|
decisionsReached?: string[];
|
|
101
|
+
keyFindings?: string[];
|
|
103
102
|
nextSteps?: string[];
|
|
104
|
-
|
|
103
|
+
worktreeId: string;
|
|
104
|
+
}
|
|
105
105
|
/** Input for moving a worktree forward to its next phase. */
|
|
106
|
-
export
|
|
106
|
+
export interface AdvanceWorktreePhaseInput {
|
|
107
107
|
worktreeId: string;
|
|
108
|
-
}
|
|
108
|
+
}
|
|
109
109
|
/** Input for forcing a worktree into a specific phase. */
|
|
110
|
-
export
|
|
111
|
-
worktreeId: string;
|
|
110
|
+
export interface SetWorktreePhaseInput {
|
|
112
111
|
phase: string;
|
|
113
|
-
};
|
|
114
|
-
/** Input for patching arbitrary structured worktree state. */
|
|
115
|
-
export type PatchWorktreeStateInput = {
|
|
116
112
|
worktreeId: string;
|
|
113
|
+
}
|
|
114
|
+
/** Input for patching arbitrary structured worktree state. */
|
|
115
|
+
export interface PatchWorktreeStateInput {
|
|
117
116
|
patch: JsonObject;
|
|
118
|
-
|
|
117
|
+
worktreeId: string;
|
|
118
|
+
}
|
|
119
119
|
/** Input for batch-creating worktrees through the workflow surface. */
|
|
120
|
-
export
|
|
120
|
+
export interface BulkCreateWorktreesInput {
|
|
121
121
|
worktrees: unknown[];
|
|
122
|
-
}
|
|
122
|
+
}
|
|
123
123
|
/** Input for listing accessible topic contexts. */
|
|
124
|
-
export
|
|
124
|
+
export interface ListTopicsInput {
|
|
125
125
|
includeShared?: boolean;
|
|
126
126
|
limit?: number;
|
|
127
|
-
}
|
|
127
|
+
}
|
|
128
128
|
/** Input for switching the active topic context by name. */
|
|
129
|
-
export
|
|
129
|
+
export interface SwitchTopicContextInput {
|
|
130
130
|
targetTopicName: string;
|
|
131
|
-
}
|
|
131
|
+
}
|
|
132
132
|
/** Input for creating a workflow task linked to a question or worktree. */
|
|
133
133
|
export type CreateTaskInput = {
|
|
134
134
|
title: string;
|
|
@@ -141,22 +141,22 @@ export type CreateTaskInput = {
|
|
|
141
141
|
priority?: "low" | "medium" | "high" | "urgent";
|
|
142
142
|
} & TopicIdentifierInput;
|
|
143
143
|
/** Input for marking a workflow task as completed with an output summary. */
|
|
144
|
-
export
|
|
145
|
-
outputSummary: string;
|
|
144
|
+
export interface CompleteTaskInput {
|
|
146
145
|
evidenceCreated?: boolean;
|
|
147
|
-
|
|
146
|
+
outputSummary: string;
|
|
147
|
+
}
|
|
148
148
|
/** Input for partially updating an existing workflow task. */
|
|
149
|
-
export
|
|
150
|
-
|
|
149
|
+
export interface UpdateTaskInput {
|
|
150
|
+
assigneeId?: string;
|
|
151
|
+
blockedReason?: string;
|
|
151
152
|
description?: string;
|
|
152
153
|
linkedBeliefId?: string;
|
|
153
154
|
linkedQuestionId?: string;
|
|
154
155
|
linkedWorktreeId?: string;
|
|
155
|
-
priority?: "
|
|
156
|
+
priority?: "urgent" | "high" | "medium" | "low";
|
|
156
157
|
status?: "todo" | "in_progress" | "blocked" | "done";
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
};
|
|
158
|
+
title?: string;
|
|
159
|
+
}
|
|
160
160
|
/**
|
|
161
161
|
* Create the workflow client for lenses, legacy branches, worktrees, context,
|
|
162
162
|
* and tasks.
|
|
@@ -202,6 +202,7 @@ export declare function createWorkflowClient(config?: WorkflowClientConfig): {
|
|
|
202
202
|
promptTemplates?: LensPromptTemplateReference[];
|
|
203
203
|
workflowTemplates?: LensWorkflowTemplate[];
|
|
204
204
|
taskTemplates?: LensTaskTemplate[];
|
|
205
|
+
questionTemplates?: LensQuestionTemplate[];
|
|
205
206
|
filterCriteria?: JsonObject;
|
|
206
207
|
} & TopicIdentifierInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<WorkflowLensRecord>>;
|
|
207
208
|
/**
|
package/dist/workflowClient.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LucernApiError as CoreLucernApiError, createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
|
|
2
2
|
import { asListItems, createListResult, mapAliasedList, mapGatewayData, normalizeTopicQuery, resolveTopicId, withTopicAlias, } from "./sdkSurface.js";
|
|
3
|
-
export { LucernApiError };
|
|
3
|
+
export { LucernApiError } from "./coreClient.js";
|
|
4
4
|
function normalizeLensQuery(value) {
|
|
5
5
|
const topicId = resolveTopicId(value);
|
|
6
6
|
return {
|
|
@@ -8,6 +8,12 @@ function normalizeLensQuery(value) {
|
|
|
8
8
|
...(topicId ? { topicId } : {}),
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
+
function optionalBooleanQueryParam(value) {
|
|
12
|
+
if (typeof value !== "boolean") {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
return value ? "true" : "false";
|
|
16
|
+
}
|
|
11
17
|
/**
|
|
12
18
|
* Create the workflow client for lenses, legacy branches, worktrees, context,
|
|
13
19
|
* and tasks.
|
|
@@ -20,81 +26,94 @@ export function createWorkflowClient(config = {}) {
|
|
|
20
26
|
/**
|
|
21
27
|
* List workflow branches for a topic scope.
|
|
22
28
|
*/
|
|
23
|
-
|
|
24
|
-
return gateway
|
|
29
|
+
listBranches(query) {
|
|
30
|
+
return gateway
|
|
31
|
+
.request({
|
|
25
32
|
path: `/api/platform/v1/workflow/branches${toQueryString(normalizeTopicQuery(query))}`,
|
|
26
|
-
})
|
|
33
|
+
})
|
|
34
|
+
.then((response) => mapGatewayData(response, (data) => mapAliasedList(data, "branches")));
|
|
27
35
|
},
|
|
28
36
|
/**
|
|
29
37
|
* Create a workflow branch.
|
|
30
38
|
*/
|
|
31
|
-
|
|
32
|
-
return gateway
|
|
39
|
+
createBranch(input, idempotencyKey) {
|
|
40
|
+
return gateway
|
|
41
|
+
.request({
|
|
33
42
|
path: "/api/platform/v1/workflow/branches",
|
|
34
43
|
method: "POST",
|
|
35
44
|
body: normalizeTopicQuery(input),
|
|
36
45
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
37
|
-
})
|
|
46
|
+
})
|
|
47
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
38
48
|
},
|
|
39
49
|
/**
|
|
40
50
|
* List reusable lenses for a workspace or topic scope.
|
|
41
51
|
*/
|
|
42
|
-
|
|
43
|
-
return gateway
|
|
52
|
+
listLenses(query) {
|
|
53
|
+
return gateway
|
|
54
|
+
.request({
|
|
44
55
|
path: `/api/platform/v1/workflow/lenses${toQueryString(normalizeLensQuery(query))}`,
|
|
45
|
-
})
|
|
56
|
+
})
|
|
57
|
+
.then((response) => mapGatewayData(response, (data) => mapAliasedList(data, "lenses")));
|
|
46
58
|
},
|
|
47
59
|
/**
|
|
48
60
|
* Create a reusable workflow lens.
|
|
49
61
|
*/
|
|
50
|
-
|
|
62
|
+
createLens(input, idempotencyKey) {
|
|
51
63
|
const payload = normalizeLensQuery(input);
|
|
52
|
-
return gateway
|
|
64
|
+
return gateway
|
|
65
|
+
.request({
|
|
53
66
|
path: "/api/platform/v1/workflow/lenses",
|
|
54
67
|
method: "POST",
|
|
55
68
|
body: payload,
|
|
56
69
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
57
|
-
})
|
|
70
|
+
})
|
|
71
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
58
72
|
},
|
|
59
73
|
/**
|
|
60
74
|
* Apply an existing lens to a topic.
|
|
61
75
|
*/
|
|
62
|
-
|
|
76
|
+
applyLensToTopic(input, idempotencyKey) {
|
|
63
77
|
const payload = normalizeLensQuery(input);
|
|
64
|
-
return gateway
|
|
78
|
+
return gateway
|
|
79
|
+
.request({
|
|
65
80
|
path: "/api/platform/v1/workflow/lens-bindings",
|
|
66
81
|
method: "POST",
|
|
67
82
|
body: payload,
|
|
68
83
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
69
|
-
})
|
|
84
|
+
})
|
|
85
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
70
86
|
},
|
|
71
87
|
/**
|
|
72
88
|
* Remove an applied lens from a topic.
|
|
73
89
|
*/
|
|
74
|
-
|
|
90
|
+
removeLensFromTopic(input, idempotencyKey) {
|
|
75
91
|
const topicId = resolveTopicId(input);
|
|
76
92
|
if (!topicId) {
|
|
77
|
-
|
|
93
|
+
return Promise.reject(new CoreLucernApiError({
|
|
78
94
|
code: "INVALID_REQUEST",
|
|
79
95
|
message: "topicId is required",
|
|
80
96
|
status: 400,
|
|
81
|
-
});
|
|
97
|
+
}));
|
|
82
98
|
}
|
|
83
|
-
return gateway
|
|
99
|
+
return gateway
|
|
100
|
+
.request({
|
|
84
101
|
path: `/api/platform/v1/workflow/lens-bindings${toQueryString({
|
|
85
102
|
lensId: input.lensId,
|
|
86
103
|
topicId,
|
|
87
104
|
})}`,
|
|
88
105
|
method: "DELETE",
|
|
89
106
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
90
|
-
})
|
|
107
|
+
})
|
|
108
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
91
109
|
},
|
|
92
110
|
/**
|
|
93
111
|
* List worktrees for a topic scope.
|
|
94
112
|
*/
|
|
95
|
-
|
|
113
|
+
listWorktrees(query) {
|
|
96
114
|
const normalized = normalizeTopicQuery(query);
|
|
97
|
-
return gateway
|
|
115
|
+
return gateway
|
|
116
|
+
.request({
|
|
98
117
|
path: `/api/platform/v1/worktrees${toQueryString({
|
|
99
118
|
...normalized,
|
|
100
119
|
groupBy: query.groupBy,
|
|
@@ -102,13 +121,15 @@ export function createWorkflowClient(config = {}) {
|
|
|
102
121
|
campaign: query.campaign,
|
|
103
122
|
limit: query.limit,
|
|
104
123
|
})}`,
|
|
105
|
-
})
|
|
124
|
+
})
|
|
125
|
+
.then((response) => mapGatewayData(response, (data) => mapAliasedList(data, "worktrees")));
|
|
106
126
|
},
|
|
107
127
|
/**
|
|
108
128
|
* List all worktrees across accessible topics.
|
|
109
129
|
*/
|
|
110
|
-
|
|
111
|
-
return gateway
|
|
130
|
+
listAllWorktrees(query = {}) {
|
|
131
|
+
return gateway
|
|
132
|
+
.request({
|
|
112
133
|
path: `/api/platform/v1/worktrees/all${toQueryString({
|
|
113
134
|
status: query.status,
|
|
114
135
|
groupBy: query.groupBy,
|
|
@@ -116,7 +137,8 @@ export function createWorkflowClient(config = {}) {
|
|
|
116
137
|
campaign: query.campaign,
|
|
117
138
|
limit: query.limit,
|
|
118
139
|
})}`,
|
|
119
|
-
})
|
|
140
|
+
})
|
|
141
|
+
.then((response) => mapGatewayData(response, (data) => {
|
|
120
142
|
const record = data && typeof data === "object" && !Array.isArray(data)
|
|
121
143
|
? data
|
|
122
144
|
: {};
|
|
@@ -139,7 +161,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
139
161
|
/**
|
|
140
162
|
* List compact pipeline campaigns with nested lanes.
|
|
141
163
|
*/
|
|
142
|
-
|
|
164
|
+
listCampaigns(query = {}) {
|
|
143
165
|
return gateway.request({
|
|
144
166
|
path: `/api/platform/v1/worktrees/campaigns${toQueryString(normalizeTopicQuery(query))}`,
|
|
145
167
|
});
|
|
@@ -147,18 +169,20 @@ export function createWorkflowClient(config = {}) {
|
|
|
147
169
|
/**
|
|
148
170
|
* Create a workflow worktree.
|
|
149
171
|
*/
|
|
150
|
-
|
|
151
|
-
return gateway
|
|
172
|
+
createWorktree(input, idempotencyKey) {
|
|
173
|
+
return gateway
|
|
174
|
+
.request({
|
|
152
175
|
path: "/api/platform/v1/worktrees",
|
|
153
176
|
method: "POST",
|
|
154
177
|
body: normalizeTopicQuery(input),
|
|
155
178
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
156
|
-
})
|
|
179
|
+
})
|
|
180
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
157
181
|
},
|
|
158
182
|
/**
|
|
159
183
|
* Merge a worktree into the main belief line.
|
|
160
184
|
*/
|
|
161
|
-
|
|
185
|
+
merge(worktreeId, input, idempotencyKey) {
|
|
162
186
|
return gateway.request({
|
|
163
187
|
path: `/api/platform/v1/worktrees/${encodeURIComponent(worktreeId)}/merge`,
|
|
164
188
|
method: "POST",
|
|
@@ -169,29 +193,33 @@ export function createWorkflowClient(config = {}) {
|
|
|
169
193
|
/**
|
|
170
194
|
* Activate a planning worktree.
|
|
171
195
|
*/
|
|
172
|
-
|
|
173
|
-
return gateway
|
|
196
|
+
activateWorktree(worktreeId, idempotencyKey) {
|
|
197
|
+
return gateway
|
|
198
|
+
.request({
|
|
174
199
|
path: `/api/platform/v1/worktrees/${encodeURIComponent(worktreeId)}/activate`,
|
|
175
200
|
method: "POST",
|
|
176
201
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
177
|
-
})
|
|
202
|
+
})
|
|
203
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
178
204
|
},
|
|
179
205
|
/**
|
|
180
206
|
* Update targeted beliefs/questions for a worktree.
|
|
181
207
|
*/
|
|
182
|
-
|
|
208
|
+
updateWorktreeTargets(input, idempotencyKey) {
|
|
183
209
|
const { worktreeId, ...body } = input;
|
|
184
|
-
return gateway
|
|
210
|
+
return gateway
|
|
211
|
+
.request({
|
|
185
212
|
path: `/api/platform/v1/worktrees/${encodeURIComponent(worktreeId)}/targets`,
|
|
186
213
|
method: "POST",
|
|
187
214
|
body,
|
|
188
215
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
189
|
-
})
|
|
216
|
+
})
|
|
217
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
190
218
|
},
|
|
191
219
|
/**
|
|
192
220
|
* Mark a worktree record complete.
|
|
193
221
|
*/
|
|
194
|
-
|
|
222
|
+
completeWorktree(input, idempotencyKey) {
|
|
195
223
|
return gateway.request({
|
|
196
224
|
path: "/api/platform/v1/worktrees/complete",
|
|
197
225
|
method: "POST",
|
|
@@ -202,7 +230,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
202
230
|
/**
|
|
203
231
|
* Advance a worktree to its next lifecycle phase.
|
|
204
232
|
*/
|
|
205
|
-
|
|
233
|
+
advanceWorktreePhase(input, idempotencyKey) {
|
|
206
234
|
return gateway.request({
|
|
207
235
|
path: "/api/platform/v1/worktrees/advance-phase",
|
|
208
236
|
method: "POST",
|
|
@@ -213,7 +241,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
213
241
|
/**
|
|
214
242
|
* Force a worktree into a specific lifecycle phase.
|
|
215
243
|
*/
|
|
216
|
-
|
|
244
|
+
setWorktreePhase(input, idempotencyKey) {
|
|
217
245
|
return gateway.request({
|
|
218
246
|
path: "/api/platform/v1/worktrees/set-phase",
|
|
219
247
|
method: "POST",
|
|
@@ -224,7 +252,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
224
252
|
/**
|
|
225
253
|
* Patch opaque worktree state for orchestration flows.
|
|
226
254
|
*/
|
|
227
|
-
|
|
255
|
+
patchWorktreeState(input, idempotencyKey) {
|
|
228
256
|
return gateway.request({
|
|
229
257
|
path: "/api/platform/v1/worktrees/patch-state",
|
|
230
258
|
method: "POST",
|
|
@@ -235,7 +263,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
235
263
|
/**
|
|
236
264
|
* Batch create worktree records.
|
|
237
265
|
*/
|
|
238
|
-
|
|
266
|
+
bulkCreateWorktrees(input, idempotencyKey) {
|
|
239
267
|
return gateway.request({
|
|
240
268
|
path: "/api/platform/v1/worktrees/bulk",
|
|
241
269
|
method: "POST",
|
|
@@ -246,7 +274,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
246
274
|
/**
|
|
247
275
|
* Open a pull request for a worktree.
|
|
248
276
|
*/
|
|
249
|
-
|
|
277
|
+
openPullRequest(worktreeId, input, idempotencyKey) {
|
|
250
278
|
return gateway.request({
|
|
251
279
|
path: `/api/platform/v1/workflow/worktrees/${encodeURIComponent(worktreeId)}/pull-request`,
|
|
252
280
|
method: "POST",
|
|
@@ -257,7 +285,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
257
285
|
/**
|
|
258
286
|
* Push scored worktree findings into another context.
|
|
259
287
|
*/
|
|
260
|
-
|
|
288
|
+
push(worktreeId, input, idempotencyKey) {
|
|
261
289
|
return gateway.request({
|
|
262
290
|
path: `/api/platform/v1/workflow/worktrees/${encodeURIComponent(worktreeId)}/push`,
|
|
263
291
|
method: "POST",
|
|
@@ -268,17 +296,15 @@ export function createWorkflowClient(config = {}) {
|
|
|
268
296
|
/**
|
|
269
297
|
* List accessible topic contexts.
|
|
270
298
|
*/
|
|
271
|
-
|
|
272
|
-
return gateway
|
|
299
|
+
listTopics(query = {}) {
|
|
300
|
+
return gateway
|
|
301
|
+
.request({
|
|
273
302
|
path: `/api/platform/v1/workflow/topics${toQueryString({
|
|
274
|
-
includeShared:
|
|
275
|
-
? query.includeShared
|
|
276
|
-
? "true"
|
|
277
|
-
: "false"
|
|
278
|
-
: undefined,
|
|
303
|
+
includeShared: optionalBooleanQueryParam(query.includeShared),
|
|
279
304
|
limit: query.limit,
|
|
280
305
|
})}`,
|
|
281
|
-
})
|
|
306
|
+
})
|
|
307
|
+
.then((response) => mapGatewayData(response, (data) => {
|
|
282
308
|
const items = asListItems(data, "topics").map((item) => withTopicAlias(item));
|
|
283
309
|
const record = data && typeof data === "object"
|
|
284
310
|
? data
|
|
@@ -293,20 +319,22 @@ export function createWorkflowClient(config = {}) {
|
|
|
293
319
|
/**
|
|
294
320
|
* Switch the active context by topic or project name.
|
|
295
321
|
*/
|
|
296
|
-
|
|
297
|
-
return gateway
|
|
322
|
+
switchTopicContext(input, idempotencyKey) {
|
|
323
|
+
return gateway
|
|
324
|
+
.request({
|
|
298
325
|
path: "/api/platform/v1/workflow/topics/switch",
|
|
299
326
|
method: "POST",
|
|
300
327
|
body: {
|
|
301
328
|
targetTopicName: input.targetTopicName,
|
|
302
329
|
},
|
|
303
330
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
304
|
-
})
|
|
331
|
+
})
|
|
332
|
+
.then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
305
333
|
},
|
|
306
334
|
/**
|
|
307
335
|
* Create a workflow task.
|
|
308
336
|
*/
|
|
309
|
-
|
|
337
|
+
createTask(input, idempotencyKey) {
|
|
310
338
|
return gateway.request({
|
|
311
339
|
path: "/api/platform/v1/workflow/tasks",
|
|
312
340
|
method: "POST",
|
|
@@ -317,7 +345,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
317
345
|
/**
|
|
318
346
|
* Complete a workflow task.
|
|
319
347
|
*/
|
|
320
|
-
|
|
348
|
+
completeTask(taskId, input, idempotencyKey) {
|
|
321
349
|
return gateway.request({
|
|
322
350
|
path: `/api/platform/v1/workflow/tasks/${encodeURIComponent(taskId)}/complete`,
|
|
323
351
|
method: "POST",
|
|
@@ -328,7 +356,7 @@ export function createWorkflowClient(config = {}) {
|
|
|
328
356
|
/**
|
|
329
357
|
* Update a workflow task.
|
|
330
358
|
*/
|
|
331
|
-
|
|
359
|
+
updateTask(taskId, input, idempotencyKey) {
|
|
332
360
|
return gateway.request({
|
|
333
361
|
path: `/api/platform/v1/workflow/tasks/${encodeURIComponent(taskId)}`,
|
|
334
362
|
method: "PATCH",
|