@lucern/mcp 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/dist/runtime.js CHANGED
@@ -7633,15 +7633,15 @@ var IDENTITY_WHOAMI = {
7633
7633
  };
7634
7634
  var COMPILE_CONTEXT = {
7635
7635
  name: "compile_context",
7636
- description: "Compile a focused reasoning context for a topic. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
7636
+ description: "Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
7637
7637
  parameters: {
7638
7638
  topicId: {
7639
7639
  type: "string",
7640
- description: "Topic scope ID to compile"
7640
+ description: "Optional topic scope ID. Omit to resolve the topic from query."
7641
7641
  },
7642
7642
  query: {
7643
7643
  type: "string",
7644
- description: "Optional focus query used to rank context items"
7644
+ description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
7645
7645
  },
7646
7646
  budget: {
7647
7647
  type: "number",
@@ -7665,7 +7665,7 @@ var COMPILE_CONTEXT = {
7665
7665
  description: "Include related ontological entities in the compiled result"
7666
7666
  }
7667
7667
  },
7668
- required: ["topicId"],
7668
+ required: [],
7669
7669
  response: {
7670
7670
  description: "Compiled context pack for the requested topic",
7671
7671
  fields: {
@@ -10164,7 +10164,7 @@ var contextContracts = [
10164
10164
  path: "/context/compile",
10165
10165
  sdkNamespace: "context",
10166
10166
  sdkMethod: "compileContext",
10167
- summary: "Compile a focused reasoning context for a topic.",
10167
+ summary: "Compile a focused reasoning context, resolving topic from query when omitted.",
10168
10168
  convex: {
10169
10169
  module: "contextCompiler",
10170
10170
  functionName: "compile",
@@ -17032,10 +17032,20 @@ function toPublicCompiledContext(pack) {
17032
17032
  var scopeContextHandlers = {
17033
17033
  async compile_context(args, ctx) {
17034
17034
  const requestedScope = readTopicIdArg(args);
17035
- if (!requestedScope) {
17036
- throw new Error("[compile_context] topicId is required.");
17037
- }
17038
- const topicId = await resolveTopicScopeId(requestedScope, "compile_context");
17035
+ const query = readString(args.query);
17036
+ if (!requestedScope && !query) {
17037
+ throw new Error("[compile_context] query is required when topicId is omitted.");
17038
+ }
17039
+ const topicId = requestedScope ? await resolveTopicScopeId(requestedScope, "compile_context") : (await resolveTopicForWrite(ctx, {
17040
+ workspaceId: readString(args.workspaceId),
17041
+ topicHint: readString(args.topicHint),
17042
+ summary: query ?? "",
17043
+ tags: readStringArray(args.tags),
17044
+ touchedPaths: readStringArray(args.touchedPaths),
17045
+ sourceRef: readString(args.sourceRef),
17046
+ sourceKind: readString(args.sourceKind) ?? "compile_context",
17047
+ autoCreate: false
17048
+ })).topicId;
17039
17049
  if (ctx.sessionType === "user" && Array.isArray(ctx.allowedTopics) && (!ctx.allowedTopics.includes(topicId) || ctx.allowedTopics.length === 0)) {
17040
17050
  throw new Error(
17041
17051
  `[compile_context] Access denied to compile context for topic ${topicId}.`