@lucern/contracts 1.0.3 → 1.0.4

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/context-pack.contract.d.ts +10 -0
  3. package/dist/context-pack.contract.js.map +1 -1
  4. package/dist/dsl.d.ts +1 -0
  5. package/dist/dsl.js +10 -3
  6. package/dist/dsl.js.map +1 -1
  7. package/dist/dsl.values.js +10 -3
  8. package/dist/dsl.values.js.map +1 -1
  9. package/dist/function-registry/beliefs.js +302 -0
  10. package/dist/function-registry/beliefs.js.map +1 -1
  11. package/dist/function-registry/coding.js +302 -0
  12. package/dist/function-registry/coding.js.map +1 -1
  13. package/dist/function-registry/context.js +302 -0
  14. package/dist/function-registry/context.js.map +1 -1
  15. package/dist/function-registry/contracts.js +302 -0
  16. package/dist/function-registry/contracts.js.map +1 -1
  17. package/dist/function-registry/coordination.js +302 -0
  18. package/dist/function-registry/coordination.js.map +1 -1
  19. package/dist/function-registry/edges.js +302 -0
  20. package/dist/function-registry/edges.js.map +1 -1
  21. package/dist/function-registry/evidence.js +302 -0
  22. package/dist/function-registry/evidence.js.map +1 -1
  23. package/dist/function-registry/graph.js +302 -0
  24. package/dist/function-registry/graph.js.map +1 -1
  25. package/dist/function-registry/helpers.js +302 -0
  26. package/dist/function-registry/helpers.js.map +1 -1
  27. package/dist/function-registry/identity.js +302 -0
  28. package/dist/function-registry/identity.js.map +1 -1
  29. package/dist/function-registry/index.d.ts +410 -6
  30. package/dist/function-registry/index.js +508 -2
  31. package/dist/function-registry/index.js.map +1 -1
  32. package/dist/function-registry/judgments.js +302 -0
  33. package/dist/function-registry/judgments.js.map +1 -1
  34. package/dist/function-registry/legacy.js +302 -0
  35. package/dist/function-registry/legacy.js.map +1 -1
  36. package/dist/function-registry/lenses.js +302 -0
  37. package/dist/function-registry/lenses.js.map +1 -1
  38. package/dist/function-registry/manifest.d.ts +2 -2
  39. package/dist/function-registry/manifest.js +10 -0
  40. package/dist/function-registry/manifest.js.map +1 -1
  41. package/dist/function-registry/nodes.js +302 -0
  42. package/dist/function-registry/nodes.js.map +1 -1
  43. package/dist/function-registry/ontologies.js +302 -0
  44. package/dist/function-registry/ontologies.js.map +1 -1
  45. package/dist/function-registry/pipeline.js +302 -0
  46. package/dist/function-registry/pipeline.js.map +1 -1
  47. package/dist/function-registry/questions.js +302 -0
  48. package/dist/function-registry/questions.js.map +1 -1
  49. package/dist/function-registry/tasks.js +302 -0
  50. package/dist/function-registry/tasks.js.map +1 -1
  51. package/dist/function-registry/topics.js +302 -0
  52. package/dist/function-registry/topics.js.map +1 -1
  53. package/dist/function-registry/worktrees.js +302 -0
  54. package/dist/function-registry/worktrees.js.map +1 -1
  55. package/dist/generated/convexSchemas.js +1 -1
  56. package/dist/generated/convexSchemas.js.map +1 -1
  57. package/dist/generated/infisicalRuntimeEnv.js +9 -9
  58. package/dist/generated/infisicalRuntimeEnv.js.map +1 -1
  59. package/dist/generated/schema-manifest.json +10 -1
  60. package/dist/index.d.ts +3 -1
  61. package/dist/index.js +343 -17
  62. package/dist/index.js.map +1 -1
  63. package/dist/infisical-runtime.contract.d.ts +3 -3
  64. package/dist/infisical-runtime.contract.js +3 -3
  65. package/dist/infisical-runtime.contract.js.map +1 -1
  66. package/dist/infisical-runtime.platform-secrets.d.ts +3 -3
  67. package/dist/infisical-runtime.platform-secrets.js +3 -3
  68. package/dist/infisical-runtime.platform-secrets.js.map +1 -1
  69. package/dist/manifests/edge-policy-manifest.d.ts +1 -1
  70. package/dist/manifests/infisical-runtime-manifest.d.ts +3 -3
  71. package/dist/manifests/infisical-runtime-manifest.js +3 -3
  72. package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
  73. package/dist/proof-attestation.json +1 -1
  74. package/dist/schemas/index.js +29 -2
  75. package/dist/schemas/index.js.map +1 -1
  76. package/dist/schemas/manifest.d.ts +60 -25
  77. package/dist/schemas/manifest.js +29 -2
  78. package/dist/schemas/manifest.js.map +1 -1
  79. package/dist/schemas/tables/kernel/embedding.d.ts +8 -1
  80. package/dist/schemas/tables/kernel/embedding.js +29 -2
  81. package/dist/schemas/tables/kernel/embedding.js.map +1 -1
  82. package/dist/schemas/tables/kernel/intelligence.d.ts +4 -4
  83. package/dist/schemas.values.js +29 -2
  84. package/dist/schemas.values.js.map +1 -1
  85. package/dist/sdk-methods.contract.d.ts +5 -0
  86. package/dist/sdk-tools.contract.js +292 -0
  87. package/dist/sdk-tools.contract.js.map +1 -1
  88. package/dist/sdk-tools.contract.registry.js +292 -0
  89. package/dist/sdk-tools.contract.registry.js.map +1 -1
  90. package/dist/sdk-tools.contract.values.js +292 -0
  91. package/dist/sdk-tools.contract.values.js.map +1 -1
  92. package/dist/tool-contracts.d.ts +2 -0
  93. package/dist/tool-contracts.embeddings.d.ts +8 -0
  94. package/dist/tool-contracts.embeddings.js +120 -0
  95. package/dist/tool-contracts.embeddings.js.map +1 -0
  96. package/dist/tool-contracts.hybrid-discovery.d.ts +10 -0
  97. package/dist/tool-contracts.hybrid-discovery.js +148 -0
  98. package/dist/tool-contracts.hybrid-discovery.js.map +1 -0
  99. package/dist/tool-contracts.js +293 -1
  100. package/dist/tool-contracts.js.map +1 -1
  101. package/dist/tool-contracts.questions-listing.js +20 -0
  102. package/dist/tool-contracts.questions-listing.js.map +1 -1
  103. package/dist/tool-contracts.values.d.ts +2 -0
  104. package/dist/tool-contracts.values.js +292 -0
  105. package/dist/tool-contracts.values.js.map +1 -1
  106. package/package.json +10 -2
  107. package/dist/{edge-policy-manifest-4KOSP4nk.d.ts → edge-policy-manifest-CT8Y4IeW.d.ts} +2 -2
@@ -1057,6 +1057,268 @@ var BATCH_CREATE_EDGES = {
1057
1057
  tier: "workhorse"
1058
1058
  };
1059
1059
 
1060
+ // src/tool-contracts.embeddings.ts
1061
+ var sharedEmbeddingParameters = {
1062
+ topicId: {
1063
+ type: "string",
1064
+ description: "Topic whose epistemic node embedding index should be queried."
1065
+ },
1066
+ workspaceId: {
1067
+ type: "string",
1068
+ description: "Workspace scope for the embedding operation."
1069
+ },
1070
+ nodeType: {
1071
+ type: "string",
1072
+ description: "Optional epistemic node type filter."
1073
+ },
1074
+ embeddingModel: {
1075
+ type: "string",
1076
+ description: "Optional embedding model filter."
1077
+ },
1078
+ limit: {
1079
+ type: "number",
1080
+ description: "Maximum rows to return."
1081
+ }
1082
+ };
1083
+ var LIST_MISSING_EMBEDDINGS = {
1084
+ name: "list_missing_embeddings",
1085
+ description: "List epistemic nodes missing fresh Convex embeddings. Like `git status` for the semantic index \u2014 shows which graph nodes still need indexing before retrieval can be trusted.",
1086
+ parameters: sharedEmbeddingParameters,
1087
+ required: ["topicId", "workspaceId"],
1088
+ response: {
1089
+ description: "Missing or stale embedding candidates",
1090
+ fields: {
1091
+ nodes: "array \u2014 node candidates missing fresh embeddings",
1092
+ total: "number \u2014 candidate count",
1093
+ nextCursor: "string | null"
1094
+ }
1095
+ },
1096
+ ownerModule: "reasoning-kernel",
1097
+ ontologyPrimitive: "graph",
1098
+ tier: "workhorse"
1099
+ };
1100
+ var SEARCH_EMBEDDINGS = {
1101
+ name: "search_embeddings",
1102
+ description: "Search topic-scoped epistemic nodes through the Convex vector index. Like `git grep` with semantic distance \u2014 finds matching beliefs, questions, evidence, and other nodes even when wording differs.",
1103
+ parameters: {
1104
+ ...sharedEmbeddingParameters,
1105
+ queryText: {
1106
+ type: "string",
1107
+ description: "Natural-language query to embed and search with."
1108
+ },
1109
+ queryVector: {
1110
+ type: "array",
1111
+ description: "Optional precomputed query vector."
1112
+ },
1113
+ minScore: {
1114
+ type: "number",
1115
+ description: "Optional minimum cosine-similarity score."
1116
+ }
1117
+ },
1118
+ required: ["topicId", "workspaceId"],
1119
+ response: {
1120
+ description: "Vector search matches",
1121
+ fields: {
1122
+ results: "array \u2014 semantic matches with nodeId, nodeType, score, text, and provenance",
1123
+ total: "number \u2014 match count",
1124
+ nextCursor: "string | null"
1125
+ }
1126
+ },
1127
+ ownerModule: "reasoning-kernel",
1128
+ ontologyPrimitive: "graph",
1129
+ tier: "showcase"
1130
+ };
1131
+ var GET_EMBEDDINGS_BY_NODE_IDS = {
1132
+ name: "get_embeddings_by_node_ids",
1133
+ description: "Fetch embedding records for explicit epistemic node IDs. Like `git show` for semantic-index rows \u2014 inspects exactly which vectors exist for named graph nodes.",
1134
+ parameters: {
1135
+ ...sharedEmbeddingParameters,
1136
+ nodeIds: {
1137
+ type: "array",
1138
+ description: "Epistemic node IDs to inspect."
1139
+ }
1140
+ },
1141
+ required: ["topicId", "workspaceId", "nodeIds"],
1142
+ response: {
1143
+ description: "Embedding records for explicit node IDs",
1144
+ fields: {
1145
+ embeddings: "array \u2014 embedding metadata records",
1146
+ total: "number \u2014 embedding count",
1147
+ nextCursor: "string | null"
1148
+ }
1149
+ },
1150
+ ownerModule: "reasoning-kernel",
1151
+ ontologyPrimitive: "graph",
1152
+ tier: "workhorse"
1153
+ };
1154
+ var QUEUE_EMBEDDING_BACKFILL = {
1155
+ name: "queue_embedding_backfill",
1156
+ description: "Queue background embedding generation for explicit epistemic nodes. Like `git add` for semantic-index work \u2014 stages graph nodes for the kernel backfill scheduler.",
1157
+ parameters: {
1158
+ ...sharedEmbeddingParameters,
1159
+ nodeIds: {
1160
+ type: "array",
1161
+ description: "Epistemic node IDs to queue for embedding generation."
1162
+ }
1163
+ },
1164
+ required: ["topicId", "workspaceId", "nodeIds"],
1165
+ response: {
1166
+ description: "Backfill queue receipt",
1167
+ fields: {
1168
+ queued: "number \u2014 queued node count",
1169
+ nodeIds: "array \u2014 node IDs queued for embedding generation"
1170
+ }
1171
+ },
1172
+ ownerModule: "reasoning-kernel",
1173
+ ontologyPrimitive: "graph",
1174
+ tier: "workhorse"
1175
+ };
1176
+
1177
+ // src/tool-contracts.hybrid-discovery.ts
1178
+ var hybridParameters = {
1179
+ query: {
1180
+ type: "string",
1181
+ description: "Natural-language query text to resolve against the typed reasoning graph."
1182
+ },
1183
+ queryText: {
1184
+ type: "string",
1185
+ description: "Explicit query text alias for clients that separate command words from search text."
1186
+ },
1187
+ text: {
1188
+ type: "string",
1189
+ description: "Raw pasted text to use as a semantic retrieval seed."
1190
+ },
1191
+ topicId: {
1192
+ type: "string",
1193
+ description: "Optional topic scope. When omitted, semantic topic candidates are resolved first."
1194
+ },
1195
+ workspaceId: {
1196
+ type: "string",
1197
+ description: "Optional workspace scope used by semantic topic candidates and vector search."
1198
+ },
1199
+ nodeId: {
1200
+ type: "string",
1201
+ description: "Optional source node used for related-node or impact analysis."
1202
+ },
1203
+ include: {
1204
+ type: "array",
1205
+ description: "Result families to include, such as topics, nodes, worktrees, tasks, evidence, and edges."
1206
+ },
1207
+ via: {
1208
+ type: "array",
1209
+ description: "Retrieval methods to use: bm25, embeddings, edges, topic-tree, state, graph-algorithms."
1210
+ },
1211
+ depth: {
1212
+ type: "number",
1213
+ description: "Graph expansion depth. Defaults to 1 and is capped by the server."
1214
+ },
1215
+ limit: {
1216
+ type: "number",
1217
+ description: "Maximum rows per result family."
1218
+ },
1219
+ minScore: {
1220
+ type: "number",
1221
+ description: "Minimum semantic or fused score for candidate rows."
1222
+ },
1223
+ campaign: {
1224
+ type: "number",
1225
+ description: "Optional worktree campaign filter."
1226
+ },
1227
+ lane: {
1228
+ type: "string",
1229
+ description: "Optional worktree lane filter."
1230
+ },
1231
+ status: {
1232
+ type: "string",
1233
+ description: "Optional node, task, or worktree state/status filter."
1234
+ },
1235
+ nodeTypes: {
1236
+ type: "array",
1237
+ description: "Optional epistemic node types to include."
1238
+ },
1239
+ changedPaths: {
1240
+ type: "array",
1241
+ description: "Changed file paths used as impact-analysis query signals."
1242
+ },
1243
+ metadata: {
1244
+ type: "object",
1245
+ description: "Optional planner metadata for receipts and caller provenance."
1246
+ }
1247
+ };
1248
+ var hybridResponse = {
1249
+ description: "Hybrid semantic graph planner response with ranked result families and retrieval receipt.",
1250
+ fields: {
1251
+ results: "array \u2014 ranked mixed graph results with score, kind, source, and ranking signals",
1252
+ topics: "array \u2014 candidate or traversed topics",
1253
+ nodes: "array \u2014 matching epistemic nodes",
1254
+ worktrees: "array \u2014 matching worktrees",
1255
+ tasks: "array \u2014 matching tasks",
1256
+ evidence: "array \u2014 matching evidence",
1257
+ edges: "array \u2014 graph neighborhood edges",
1258
+ receipt: "object \u2014 planner steps, candidate counts, ranking weights, source/cache posture"
1259
+ }
1260
+ };
1261
+ var HYBRID_DISCOVER = {
1262
+ name: "hybrid_discover",
1263
+ description: "Discover typed reasoning graph context with BM25, embeddings, topic tree traversal, and graph neighborhoods. Like `git grep` plus `git log --graph` for Lucern's typed reasoning graph \u2014 finds the relevant branches of thought and explains why.",
1264
+ parameters: hybridParameters,
1265
+ required: [],
1266
+ response: hybridResponse,
1267
+ ownerModule: "graph-intelligence",
1268
+ ontologyPrimitive: "graph",
1269
+ tier: "showcase"
1270
+ };
1271
+ var RESOLVE_TOPIC_SEMANTIC = {
1272
+ name: "resolve_topic_semantic",
1273
+ description: "Resolve an ambiguous topic using BM25, vector candidates, and topic-tree context. Like `git remote show` for a reasoning topic \u2014 finds the canonical branch and nearby branches before reading deeper.",
1274
+ parameters: hybridParameters,
1275
+ required: [],
1276
+ response: hybridResponse,
1277
+ ownerModule: "graph-intelligence",
1278
+ ontologyPrimitive: "graph",
1279
+ tier: "showcase"
1280
+ };
1281
+ var EXPAND_GRAPH_NEIGHBORHOOD = {
1282
+ name: "expand_graph_neighborhood",
1283
+ description: "Expand a typed graph neighborhood around a query, topic, or node. Like `git log --graph --decorate` for reasoning state \u2014 follows typed edges and surfaces the surrounding context.",
1284
+ parameters: hybridParameters,
1285
+ required: [],
1286
+ response: hybridResponse,
1287
+ ownerModule: "graph-intelligence",
1288
+ ontologyPrimitive: "graph",
1289
+ tier: "showcase"
1290
+ };
1291
+ var FIND_RELATED_NODES = {
1292
+ name: "find_related_nodes",
1293
+ description: "Find semantically and structurally related nodes across the reasoning graph. Like `git blame` across branches \u2014 starts from a node or text and finds nearby responsibility, evidence, and related claims.",
1294
+ parameters: hybridParameters,
1295
+ required: [],
1296
+ response: hybridResponse,
1297
+ ownerModule: "graph-intelligence",
1298
+ ontologyPrimitive: "graph",
1299
+ tier: "showcase"
1300
+ };
1301
+ var ANALYZE_GRAPH_IMPACT = {
1302
+ name: "analyze_graph_impact",
1303
+ description: "Analyze which graph objects are affected by files, PR text, incidents, or campaign objectives. Like `git diff --name-only` plus semantic blame \u2014 maps a change signal onto topics, beliefs, tasks, and unresolved questions.",
1304
+ parameters: hybridParameters,
1305
+ required: [],
1306
+ response: hybridResponse,
1307
+ ownerModule: "graph-intelligence",
1308
+ ontologyPrimitive: "graph",
1309
+ tier: "showcase"
1310
+ };
1311
+ var DETECT_GRAPH_DRIFT = {
1312
+ name: "detect_graph_drift",
1313
+ description: "Detect duplicate, stale, orphaned, or weakly linked reasoning graph surface. Like `git fsck` for the reasoning graph \u2014 finds semantic duplicates, stale docs/code references, and missing links.",
1314
+ parameters: hybridParameters,
1315
+ required: [],
1316
+ response: hybridResponse,
1317
+ ownerModule: "graph-intelligence",
1318
+ ontologyPrimitive: "graph",
1319
+ tier: "showcase"
1320
+ };
1321
+
1060
1322
  // src/lens-workflow.contract.ts
1061
1323
  var LENS_PERSPECTIVE_TYPES = [
1062
1324
  "investigation",
@@ -2418,6 +2680,26 @@ var COMPILE_CONTEXT = {
2418
2680
  type: "string",
2419
2681
  description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
2420
2682
  },
2683
+ topicHint: {
2684
+ type: "string",
2685
+ description: "Optional natural-language topic hint used by the resolver when topicId is omitted or stale."
2686
+ },
2687
+ tags: {
2688
+ type: "array",
2689
+ description: "Optional resolver tags. Useful for narrowing topic inference without knowing the exact topic id."
2690
+ },
2691
+ touchedPaths: {
2692
+ type: "array",
2693
+ description: "Optional file or documentation paths used as resolver signals."
2694
+ },
2695
+ sourceRef: {
2696
+ type: "string",
2697
+ description: "Optional source reference used as a resolver signal, such as a worktree id, PR, or feature slug."
2698
+ },
2699
+ sourceKind: {
2700
+ type: "string",
2701
+ description: "Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs."
2702
+ },
2421
2703
  budget: {
2422
2704
  type: "number",
2423
2705
  description: "Token budget for prompt injection planning"
@@ -4267,6 +4549,16 @@ var MCP_TOOL_CONTRACTS = {
4267
4549
  search_beliefs: SEARCH_BELIEFS,
4268
4550
  find_contradictions: FIND_CONTRADICTIONS,
4269
4551
  bisect_confidence: BISECT_CONFIDENCE,
4552
+ list_missing_embeddings: LIST_MISSING_EMBEDDINGS,
4553
+ search_embeddings: SEARCH_EMBEDDINGS,
4554
+ get_embeddings_by_node_ids: GET_EMBEDDINGS_BY_NODE_IDS,
4555
+ queue_embedding_backfill: QUEUE_EMBEDDING_BACKFILL,
4556
+ hybrid_discover: HYBRID_DISCOVER,
4557
+ resolve_topic_semantic: RESOLVE_TOPIC_SEMANTIC,
4558
+ expand_graph_neighborhood: EXPAND_GRAPH_NEIGHBORHOOD,
4559
+ find_related_nodes: FIND_RELATED_NODES,
4560
+ analyze_graph_impact: ANALYZE_GRAPH_IMPACT,
4561
+ detect_graph_drift: DETECT_GRAPH_DRIFT,
4270
4562
  // Edges (commit)
4271
4563
  create_edge: CREATE_EDGE,
4272
4564
  update_edge: UPDATE_EDGE,