@lucern/sdk 0.3.0-alpha.7 → 0.3.0-alpha.8
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 +4 -4
- package/dist/beliefs/index.js +31 -19
- package/dist/beliefs/index.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +31 -19
- package/dist/client.js.map +1 -1
- package/dist/contextClient.d.ts +4 -3
- package/dist/contextClient.js +30 -18
- package/dist/contextClient.js.map +1 -1
- package/dist/contextFacade.js +25 -16
- package/dist/contextFacade.js.map +1 -1
- package/dist/contextTypes.d.ts +2 -0
- package/dist/contradictions/index.js +31 -19
- package/dist/contradictions/index.js.map +1 -1
- package/dist/decisions/index.js +31 -19
- package/dist/decisions/index.js.map +1 -1
- package/dist/edges/index.js +31 -19
- package/dist/edges/index.js.map +1 -1
- package/dist/evidence/index.js +31 -19
- package/dist/evidence/index.js.map +1 -1
- package/dist/facade/context.d.ts +2 -1
- package/dist/facade/context.js +25 -16
- package/dist/facade/context.js.map +1 -1
- package/dist/index.js +56 -35
- package/dist/index.js.map +1 -1
- package/dist/lenses/index.js +31 -19
- package/dist/lenses/index.js.map +1 -1
- package/dist/nodes/index.js +31 -19
- package/dist/nodes/index.js.map +1 -1
- package/dist/ontologies/index.js +31 -19
- package/dist/ontologies/index.js.map +1 -1
- package/dist/questions/index.js +31 -19
- package/dist/questions/index.js.map +1 -1
- package/dist/topics/index.js +31 -19
- package/dist/topics/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/worktrees/index.js +31 -19
- package/dist/worktrees/index.js.map +1 -1
- package/package.json +4 -4
package/dist/facade/context.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ type ContextFacadeConfig = {
|
|
|
12
12
|
transport: ContextFacadeTransport;
|
|
13
13
|
};
|
|
14
14
|
declare function createContextFacade(config: ContextFacadeConfig): {
|
|
15
|
-
compile(
|
|
15
|
+
compile(topicIdOrInput?: string | CompileContextInput, input?: CompileContextInput): Promise<PublicCompiledContext>;
|
|
16
|
+
compileByQuery(input?: CompileContextInput): Promise<PublicCompiledContext>;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export { CompileContextInput, type ContextClientRequest, type ContextFacadeConfig, type ContextFacadeTransport, PublicCompiledContext, createContextFacade };
|
package/dist/facade/context.js
CHANGED
|
@@ -8,50 +8,55 @@ function cleanNumber(value) {
|
|
|
8
8
|
function cleanBoolean(value) {
|
|
9
9
|
return typeof value === "boolean" ? value : void 0;
|
|
10
10
|
}
|
|
11
|
-
function buildCompileContextRequest(
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
function buildCompileContextRequest(topicIdOrInput = {}, input = {}) {
|
|
12
|
+
const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
|
|
13
|
+
const payload = {};
|
|
14
|
+
const topicId = typeof topicIdOrInput === "string" ? cleanString(topicIdOrInput) : cleanString(effectiveInput.topicId);
|
|
15
|
+
if (topicId) {
|
|
16
|
+
payload.topicId = topicId;
|
|
17
|
+
}
|
|
18
|
+
const query = cleanString(effectiveInput.query);
|
|
14
19
|
if (query) {
|
|
15
20
|
payload.query = query;
|
|
16
21
|
}
|
|
17
|
-
const budget = cleanNumber(
|
|
22
|
+
const budget = cleanNumber(effectiveInput.budget) ?? cleanNumber(effectiveInput.tokenBudget);
|
|
18
23
|
if (budget !== void 0) {
|
|
19
24
|
payload.budget = budget;
|
|
20
25
|
}
|
|
21
|
-
const ranking = cleanString(
|
|
26
|
+
const ranking = cleanString(effectiveInput.ranking) ?? cleanString(effectiveInput.rankingProfile);
|
|
22
27
|
if (ranking) {
|
|
23
28
|
payload.ranking = ranking;
|
|
24
29
|
}
|
|
25
|
-
const limit = cleanNumber(
|
|
30
|
+
const limit = cleanNumber(effectiveInput.limit);
|
|
26
31
|
if (limit !== void 0) {
|
|
27
32
|
payload.limit = limit;
|
|
28
33
|
}
|
|
29
|
-
const maxDepth = cleanNumber(
|
|
34
|
+
const maxDepth = cleanNumber(effectiveInput.maxDepth);
|
|
30
35
|
if (maxDepth !== void 0) {
|
|
31
36
|
payload.maxDepth = maxDepth;
|
|
32
37
|
}
|
|
33
|
-
const includeEntities = cleanBoolean(
|
|
38
|
+
const includeEntities = cleanBoolean(effectiveInput.includeEntities);
|
|
34
39
|
if (includeEntities !== void 0) {
|
|
35
40
|
payload.includeEntities = includeEntities;
|
|
36
41
|
}
|
|
37
|
-
const mode = cleanString(
|
|
42
|
+
const mode = cleanString(effectiveInput.mode);
|
|
38
43
|
if (mode) {
|
|
39
44
|
payload.mode = mode;
|
|
40
45
|
}
|
|
41
|
-
const includeFailures = cleanBoolean(
|
|
46
|
+
const includeFailures = cleanBoolean(effectiveInput.includeFailures);
|
|
42
47
|
if (includeFailures !== void 0) {
|
|
43
48
|
payload.includeFailures = includeFailures;
|
|
44
49
|
}
|
|
45
|
-
const worktreeId = cleanString(
|
|
50
|
+
const worktreeId = cleanString(effectiveInput.worktreeId);
|
|
46
51
|
if (worktreeId) {
|
|
47
52
|
payload.worktreeId = worktreeId;
|
|
48
53
|
}
|
|
49
|
-
const sessionId = cleanString(
|
|
54
|
+
const sessionId = cleanString(effectiveInput.sessionId);
|
|
50
55
|
if (sessionId) {
|
|
51
56
|
payload.sessionId = sessionId;
|
|
52
57
|
}
|
|
53
|
-
if (Array.isArray(
|
|
54
|
-
payload.packWeightOverrides =
|
|
58
|
+
if (Array.isArray(effectiveInput.packWeightOverrides) && effectiveInput.packWeightOverrides.length > 0) {
|
|
59
|
+
payload.packWeightOverrides = effectiveInput.packWeightOverrides;
|
|
55
60
|
}
|
|
56
61
|
return {
|
|
57
62
|
path: "/api/platform/v1/context/compile",
|
|
@@ -61,8 +66,12 @@ function buildCompileContextRequest(topicId, input = {}) {
|
|
|
61
66
|
}
|
|
62
67
|
function createContextFacade(config) {
|
|
63
68
|
return {
|
|
64
|
-
compile(
|
|
65
|
-
const request = buildCompileContextRequest(
|
|
69
|
+
compile(topicIdOrInput = {}, input = {}) {
|
|
70
|
+
const request = buildCompileContextRequest(topicIdOrInput, input);
|
|
71
|
+
return config.transport.request(request);
|
|
72
|
+
},
|
|
73
|
+
compileByQuery(input = {}) {
|
|
74
|
+
const request = buildCompileContextRequest(input);
|
|
66
75
|
return config.transport.request(request);
|
|
67
76
|
}
|
|
68
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/facade/context.ts"],"names":[],"mappings":";AAgBA,SAAS,YAAY,KAAA,EAAoC;AACvD,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,CAAM,IAAA,GAAO,MAAA,GAAS,CAAA,GACtD,KAAA,CAAM,IAAA,EAAK,GACX,MAAA;AACN;AAEA,SAAS,YAAY,KAAA,EAAoC;AACvD,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,OAAO,QAAA,CAAS,KAAK,IAAI,KAAA,GAAQ,MAAA;AACvE;AAEA,SAAS,aAAa,KAAA,EAAqC;AACzD,EAAA,OAAO,OAAO,KAAA,KAAU,SAAA,GAAY,KAAA,GAAQ,MAAA;AAC9C;AAEA,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../src/facade/context.ts"],"names":[],"mappings":";AAgBA,SAAS,YAAY,KAAA,EAAoC;AACvD,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,CAAM,IAAA,GAAO,MAAA,GAAS,CAAA,GACtD,KAAA,CAAM,IAAA,EAAK,GACX,MAAA;AACN;AAEA,SAAS,YAAY,KAAA,EAAoC;AACvD,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,OAAO,QAAA,CAAS,KAAK,IAAI,KAAA,GAAQ,MAAA;AACvE;AAEA,SAAS,aAAa,KAAA,EAAqC;AACzD,EAAA,OAAO,OAAO,KAAA,KAAU,SAAA,GAAY,KAAA,GAAQ,MAAA;AAC9C;AAEA,SAAS,2BACP,cAAA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AAA;AAChE,MAAA,OAAO,MAAA,CAAO,SAAA,CAAU,OAAA,CAA+B,OAAO,CAAA;AAAA,IAChE,CAAA;AAAA,IACA,cAAA,CAAe,KAAA,GAA6B,EAAC,EAAG;AAC9C,MAAA,MAAM,OAAA,GAAU,2BAA2B,KAAK,CAAA;AAChD,MAAA,OAAO,MAAA,CAAO,SAAA,CAAU,OAAA,CAA+B,OAAO,CAAA;AAAA,IAChE;AAAA,GACF;AACF","file":"context.js","sourcesContent":["import type { CompileContextInput, PublicCompiledContext } from \"../contextTypes\";\n\nexport type ContextClientRequest = {\n path: \"/api/platform/v1/context/compile\";\n method: \"POST\";\n body: Record<string, unknown>;\n};\n\nexport type ContextFacadeTransport = {\n request<T>(request: ContextClientRequest): Promise<T>;\n};\n\nexport type ContextFacadeConfig = {\n transport: ContextFacadeTransport;\n};\n\nfunction cleanString(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0\n ? value.trim()\n : undefined;\n}\n\nfunction cleanNumber(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value) ? value : undefined;\n}\n\nfunction cleanBoolean(value: unknown): boolean | undefined {\n return typeof value === \"boolean\" ? value : undefined;\n}\n\nfunction buildCompileContextRequest(\n topicIdOrInput: string | CompileContextInput = {},\n input: CompileContextInput = {}\n): ContextClientRequest {\n const effectiveInput =\n typeof topicIdOrInput === \"string\" ? input : topicIdOrInput;\n const payload: Record<string, unknown> = {};\n\n const topicId =\n typeof topicIdOrInput === \"string\"\n ? cleanString(topicIdOrInput)\n : cleanString(effectiveInput.topicId);\n if (topicId) {\n payload.topicId = topicId;\n }\n\n const query = cleanString(effectiveInput.query);\n if (query) {\n payload.query = query;\n }\n\n const budget =\n cleanNumber(effectiveInput.budget) ?? cleanNumber(effectiveInput.tokenBudget);\n if (budget !== undefined) {\n payload.budget = budget;\n }\n\n const ranking =\n cleanString(effectiveInput.ranking) ?? cleanString(effectiveInput.rankingProfile);\n if (ranking) {\n payload.ranking = ranking;\n }\n\n const limit = cleanNumber(effectiveInput.limit);\n if (limit !== undefined) {\n payload.limit = limit;\n }\n\n const maxDepth = cleanNumber(effectiveInput.maxDepth);\n if (maxDepth !== undefined) {\n payload.maxDepth = maxDepth;\n }\n\n const includeEntities = cleanBoolean(effectiveInput.includeEntities);\n if (includeEntities !== undefined) {\n payload.includeEntities = includeEntities;\n }\n\n const mode = cleanString(effectiveInput.mode);\n if (mode) {\n payload.mode = mode;\n }\n\n const includeFailures = cleanBoolean(effectiveInput.includeFailures);\n if (includeFailures !== undefined) {\n payload.includeFailures = includeFailures;\n }\n\n const worktreeId = cleanString(effectiveInput.worktreeId);\n if (worktreeId) {\n payload.worktreeId = worktreeId;\n }\n\n const sessionId = cleanString(effectiveInput.sessionId);\n if (sessionId) {\n payload.sessionId = sessionId;\n }\n\n if (\n Array.isArray(effectiveInput.packWeightOverrides) &&\n effectiveInput.packWeightOverrides.length > 0\n ) {\n payload.packWeightOverrides = effectiveInput.packWeightOverrides;\n }\n\n return {\n path: \"/api/platform/v1/context/compile\",\n method: \"POST\",\n body: payload,\n };\n}\n\nexport function createContextFacade(config: ContextFacadeConfig) {\n return {\n compile(\n topicIdOrInput: string | CompileContextInput = {},\n input: CompileContextInput = {}\n ) {\n const request = buildCompileContextRequest(topicIdOrInput, input);\n return config.transport.request<PublicCompiledContext>(request);\n },\n compileByQuery(input: CompileContextInput = {}) {\n const request = buildCompileContextRequest(input);\n return config.transport.request<PublicCompiledContext>(request);\n },\n };\n}\n\nexport type { CompileContextInput, PublicCompiledContext };\n"]}
|
package/dist/index.js
CHANGED
|
@@ -4166,50 +4166,55 @@ function cleanNumber(value) {
|
|
|
4166
4166
|
function cleanBoolean(value) {
|
|
4167
4167
|
return typeof value === "boolean" ? value : void 0;
|
|
4168
4168
|
}
|
|
4169
|
-
function buildCompileContextRequest(
|
|
4170
|
-
const
|
|
4171
|
-
const
|
|
4169
|
+
function buildCompileContextRequest(topicIdOrInput = {}, input = {}) {
|
|
4170
|
+
const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
|
|
4171
|
+
const payload = {};
|
|
4172
|
+
const topicId = typeof topicIdOrInput === "string" ? cleanString4(topicIdOrInput) : cleanString4(effectiveInput.topicId);
|
|
4173
|
+
if (topicId) {
|
|
4174
|
+
payload.topicId = topicId;
|
|
4175
|
+
}
|
|
4176
|
+
const query5 = cleanString4(effectiveInput.query);
|
|
4172
4177
|
if (query5) {
|
|
4173
4178
|
payload.query = query5;
|
|
4174
4179
|
}
|
|
4175
|
-
const budget = cleanNumber(
|
|
4180
|
+
const budget = cleanNumber(effectiveInput.budget) ?? cleanNumber(effectiveInput.tokenBudget);
|
|
4176
4181
|
if (budget !== void 0) {
|
|
4177
4182
|
payload.budget = budget;
|
|
4178
4183
|
}
|
|
4179
|
-
const ranking = cleanString4(
|
|
4184
|
+
const ranking = cleanString4(effectiveInput.ranking) ?? cleanString4(effectiveInput.rankingProfile);
|
|
4180
4185
|
if (ranking) {
|
|
4181
4186
|
payload.ranking = ranking;
|
|
4182
4187
|
}
|
|
4183
|
-
const limit = cleanNumber(
|
|
4188
|
+
const limit = cleanNumber(effectiveInput.limit);
|
|
4184
4189
|
if (limit !== void 0) {
|
|
4185
4190
|
payload.limit = limit;
|
|
4186
4191
|
}
|
|
4187
|
-
const maxDepth = cleanNumber(
|
|
4192
|
+
const maxDepth = cleanNumber(effectiveInput.maxDepth);
|
|
4188
4193
|
if (maxDepth !== void 0) {
|
|
4189
4194
|
payload.maxDepth = maxDepth;
|
|
4190
4195
|
}
|
|
4191
|
-
const includeEntities = cleanBoolean(
|
|
4196
|
+
const includeEntities = cleanBoolean(effectiveInput.includeEntities);
|
|
4192
4197
|
if (includeEntities !== void 0) {
|
|
4193
4198
|
payload.includeEntities = includeEntities;
|
|
4194
4199
|
}
|
|
4195
|
-
const mode = cleanString4(
|
|
4200
|
+
const mode = cleanString4(effectiveInput.mode);
|
|
4196
4201
|
if (mode) {
|
|
4197
4202
|
payload.mode = mode;
|
|
4198
4203
|
}
|
|
4199
|
-
const includeFailures = cleanBoolean(
|
|
4204
|
+
const includeFailures = cleanBoolean(effectiveInput.includeFailures);
|
|
4200
4205
|
if (includeFailures !== void 0) {
|
|
4201
4206
|
payload.includeFailures = includeFailures;
|
|
4202
4207
|
}
|
|
4203
|
-
const worktreeId = cleanString4(
|
|
4208
|
+
const worktreeId = cleanString4(effectiveInput.worktreeId);
|
|
4204
4209
|
if (worktreeId) {
|
|
4205
4210
|
payload.worktreeId = worktreeId;
|
|
4206
4211
|
}
|
|
4207
|
-
const sessionId = cleanString4(
|
|
4212
|
+
const sessionId = cleanString4(effectiveInput.sessionId);
|
|
4208
4213
|
if (sessionId) {
|
|
4209
4214
|
payload.sessionId = sessionId;
|
|
4210
4215
|
}
|
|
4211
|
-
if (Array.isArray(
|
|
4212
|
-
payload.packWeightOverrides =
|
|
4216
|
+
if (Array.isArray(effectiveInput.packWeightOverrides) && effectiveInput.packWeightOverrides.length > 0) {
|
|
4217
|
+
payload.packWeightOverrides = effectiveInput.packWeightOverrides;
|
|
4213
4218
|
}
|
|
4214
4219
|
return {
|
|
4215
4220
|
path: "/api/platform/v1/context/compile",
|
|
@@ -4221,13 +4226,20 @@ function createContextClient(config = {}) {
|
|
|
4221
4226
|
const gateway = createGatewayRequestClient(config);
|
|
4222
4227
|
return {
|
|
4223
4228
|
/**
|
|
4224
|
-
* Compile a focused reasoning context pack
|
|
4225
|
-
* @param
|
|
4229
|
+
* Compile a focused reasoning context pack.
|
|
4230
|
+
* @param topicIdOrInput - Optional topic ID, or compile input for query-first resolution.
|
|
4226
4231
|
* @param input - Optional compile parameters (query, budget, ranking, etc.).
|
|
4227
4232
|
* @returns The compiled context payload with beliefs, questions, and evidence.
|
|
4228
4233
|
*/
|
|
4229
|
-
async compile(
|
|
4230
|
-
const request = buildCompileContextRequest(
|
|
4234
|
+
async compile(topicIdOrInput = {}, input = {}) {
|
|
4235
|
+
const request = buildCompileContextRequest(topicIdOrInput, input);
|
|
4236
|
+
return gateway.request({
|
|
4237
|
+
...request,
|
|
4238
|
+
body: request.body
|
|
4239
|
+
});
|
|
4240
|
+
},
|
|
4241
|
+
async compileByQuery(input = {}) {
|
|
4242
|
+
const request = buildCompileContextRequest(input);
|
|
4231
4243
|
return gateway.request({
|
|
4232
4244
|
...request,
|
|
4233
4245
|
body: request.body
|
|
@@ -6993,7 +7005,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
6993
7005
|
}
|
|
6994
7006
|
|
|
6995
7007
|
// src/version.ts
|
|
6996
|
-
var LUCERN_SDK_VERSION = "0.3.0-alpha.
|
|
7008
|
+
var LUCERN_SDK_VERSION = "0.3.0-alpha.8";
|
|
6997
7009
|
|
|
6998
7010
|
// src/workflowClient.ts
|
|
6999
7011
|
function normalizeLensQuery(value) {
|
|
@@ -9158,50 +9170,55 @@ function cleanNumber2(value) {
|
|
|
9158
9170
|
function cleanBoolean2(value) {
|
|
9159
9171
|
return typeof value === "boolean" ? value : void 0;
|
|
9160
9172
|
}
|
|
9161
|
-
function buildCompileContextRequest2(
|
|
9162
|
-
const
|
|
9163
|
-
const
|
|
9173
|
+
function buildCompileContextRequest2(topicIdOrInput = {}, input = {}) {
|
|
9174
|
+
const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
|
|
9175
|
+
const payload = {};
|
|
9176
|
+
const topicId = typeof topicIdOrInput === "string" ? cleanString6(topicIdOrInput) : cleanString6(effectiveInput.topicId);
|
|
9177
|
+
if (topicId) {
|
|
9178
|
+
payload.topicId = topicId;
|
|
9179
|
+
}
|
|
9180
|
+
const query5 = cleanString6(effectiveInput.query);
|
|
9164
9181
|
if (query5) {
|
|
9165
9182
|
payload.query = query5;
|
|
9166
9183
|
}
|
|
9167
|
-
const budget = cleanNumber2(
|
|
9184
|
+
const budget = cleanNumber2(effectiveInput.budget) ?? cleanNumber2(effectiveInput.tokenBudget);
|
|
9168
9185
|
if (budget !== void 0) {
|
|
9169
9186
|
payload.budget = budget;
|
|
9170
9187
|
}
|
|
9171
|
-
const ranking = cleanString6(
|
|
9188
|
+
const ranking = cleanString6(effectiveInput.ranking) ?? cleanString6(effectiveInput.rankingProfile);
|
|
9172
9189
|
if (ranking) {
|
|
9173
9190
|
payload.ranking = ranking;
|
|
9174
9191
|
}
|
|
9175
|
-
const limit = cleanNumber2(
|
|
9192
|
+
const limit = cleanNumber2(effectiveInput.limit);
|
|
9176
9193
|
if (limit !== void 0) {
|
|
9177
9194
|
payload.limit = limit;
|
|
9178
9195
|
}
|
|
9179
|
-
const maxDepth = cleanNumber2(
|
|
9196
|
+
const maxDepth = cleanNumber2(effectiveInput.maxDepth);
|
|
9180
9197
|
if (maxDepth !== void 0) {
|
|
9181
9198
|
payload.maxDepth = maxDepth;
|
|
9182
9199
|
}
|
|
9183
|
-
const includeEntities = cleanBoolean2(
|
|
9200
|
+
const includeEntities = cleanBoolean2(effectiveInput.includeEntities);
|
|
9184
9201
|
if (includeEntities !== void 0) {
|
|
9185
9202
|
payload.includeEntities = includeEntities;
|
|
9186
9203
|
}
|
|
9187
|
-
const mode = cleanString6(
|
|
9204
|
+
const mode = cleanString6(effectiveInput.mode);
|
|
9188
9205
|
if (mode) {
|
|
9189
9206
|
payload.mode = mode;
|
|
9190
9207
|
}
|
|
9191
|
-
const includeFailures = cleanBoolean2(
|
|
9208
|
+
const includeFailures = cleanBoolean2(effectiveInput.includeFailures);
|
|
9192
9209
|
if (includeFailures !== void 0) {
|
|
9193
9210
|
payload.includeFailures = includeFailures;
|
|
9194
9211
|
}
|
|
9195
|
-
const worktreeId = cleanString6(
|
|
9212
|
+
const worktreeId = cleanString6(effectiveInput.worktreeId);
|
|
9196
9213
|
if (worktreeId) {
|
|
9197
9214
|
payload.worktreeId = worktreeId;
|
|
9198
9215
|
}
|
|
9199
|
-
const sessionId = cleanString6(
|
|
9216
|
+
const sessionId = cleanString6(effectiveInput.sessionId);
|
|
9200
9217
|
if (sessionId) {
|
|
9201
9218
|
payload.sessionId = sessionId;
|
|
9202
9219
|
}
|
|
9203
|
-
if (Array.isArray(
|
|
9204
|
-
payload.packWeightOverrides =
|
|
9220
|
+
if (Array.isArray(effectiveInput.packWeightOverrides) && effectiveInput.packWeightOverrides.length > 0) {
|
|
9221
|
+
payload.packWeightOverrides = effectiveInput.packWeightOverrides;
|
|
9205
9222
|
}
|
|
9206
9223
|
return {
|
|
9207
9224
|
path: "/api/platform/v1/context/compile",
|
|
@@ -9211,8 +9228,12 @@ function buildCompileContextRequest2(topicId, input = {}) {
|
|
|
9211
9228
|
}
|
|
9212
9229
|
function createContextFacade(config) {
|
|
9213
9230
|
return {
|
|
9214
|
-
compile(
|
|
9215
|
-
const request = buildCompileContextRequest2(
|
|
9231
|
+
compile(topicIdOrInput = {}, input = {}) {
|
|
9232
|
+
const request = buildCompileContextRequest2(topicIdOrInput, input);
|
|
9233
|
+
return config.transport.request(request);
|
|
9234
|
+
},
|
|
9235
|
+
compileByQuery(input = {}) {
|
|
9236
|
+
const request = buildCompileContextRequest2(input);
|
|
9216
9237
|
return config.transport.request(request);
|
|
9217
9238
|
}
|
|
9218
9239
|
};
|