@lucern/events 1.0.3 → 1.0.5
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/index.js +539 -6
- package/dist/index.js.map +1 -1
- package/dist/outbox.js +539 -6
- package/dist/outbox.js.map +1 -1
- package/dist/proof-attestation.json +1 -1
- package/dist/types.js +539 -6
- package/dist/types.js.map +1 -1
- package/dist/webhook-delivery-machine.js +539 -6
- package/dist/webhook-delivery-machine.js.map +1 -1
- package/dist/webhooks.js +539 -6
- package/dist/webhooks.js.map +1 -1
- package/package.json +2 -2
package/dist/types.js
CHANGED
|
@@ -3919,6 +3919,26 @@ var COMPILE_CONTEXT = {
|
|
|
3919
3919
|
type: "string",
|
|
3920
3920
|
description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
|
|
3921
3921
|
},
|
|
3922
|
+
topicHint: {
|
|
3923
|
+
type: "string",
|
|
3924
|
+
description: "Optional natural-language topic hint used by the resolver when topicId is omitted or stale."
|
|
3925
|
+
},
|
|
3926
|
+
tags: {
|
|
3927
|
+
type: "array",
|
|
3928
|
+
description: "Optional resolver tags. Useful for narrowing topic inference without knowing the exact topic id."
|
|
3929
|
+
},
|
|
3930
|
+
touchedPaths: {
|
|
3931
|
+
type: "array",
|
|
3932
|
+
description: "Optional file or documentation paths used as resolver signals."
|
|
3933
|
+
},
|
|
3934
|
+
sourceRef: {
|
|
3935
|
+
type: "string",
|
|
3936
|
+
description: "Optional source reference used as a resolver signal, such as a worktree id, PR, or feature slug."
|
|
3937
|
+
},
|
|
3938
|
+
sourceKind: {
|
|
3939
|
+
type: "string",
|
|
3940
|
+
description: "Optional source kind used as a resolver signal, such as cli, worktree, commit, or docs."
|
|
3941
|
+
},
|
|
3922
3942
|
budget: {
|
|
3923
3943
|
type: "number",
|
|
3924
3944
|
description: "Token budget for prompt injection planning"
|
|
@@ -4245,6 +4265,268 @@ var OPEN_PULL_REQUEST = {
|
|
|
4245
4265
|
tier: "showcase"
|
|
4246
4266
|
};
|
|
4247
4267
|
|
|
4268
|
+
// ../contracts/src/tool-contracts.embeddings.ts
|
|
4269
|
+
var sharedEmbeddingParameters = {
|
|
4270
|
+
topicId: {
|
|
4271
|
+
type: "string",
|
|
4272
|
+
description: "Topic whose epistemic node embedding index should be queried."
|
|
4273
|
+
},
|
|
4274
|
+
workspaceId: {
|
|
4275
|
+
type: "string",
|
|
4276
|
+
description: "Workspace scope for the embedding operation."
|
|
4277
|
+
},
|
|
4278
|
+
nodeType: {
|
|
4279
|
+
type: "string",
|
|
4280
|
+
description: "Optional epistemic node type filter."
|
|
4281
|
+
},
|
|
4282
|
+
embeddingModel: {
|
|
4283
|
+
type: "string",
|
|
4284
|
+
description: "Optional embedding model filter."
|
|
4285
|
+
},
|
|
4286
|
+
limit: {
|
|
4287
|
+
type: "number",
|
|
4288
|
+
description: "Maximum rows to return."
|
|
4289
|
+
}
|
|
4290
|
+
};
|
|
4291
|
+
var LIST_MISSING_EMBEDDINGS = {
|
|
4292
|
+
name: "list_missing_embeddings",
|
|
4293
|
+
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.",
|
|
4294
|
+
parameters: sharedEmbeddingParameters,
|
|
4295
|
+
required: ["topicId", "workspaceId"],
|
|
4296
|
+
response: {
|
|
4297
|
+
description: "Missing or stale embedding candidates",
|
|
4298
|
+
fields: {
|
|
4299
|
+
nodes: "array \u2014 node candidates missing fresh embeddings",
|
|
4300
|
+
total: "number \u2014 candidate count",
|
|
4301
|
+
nextCursor: "string | null"
|
|
4302
|
+
}
|
|
4303
|
+
},
|
|
4304
|
+
ownerModule: "reasoning-kernel",
|
|
4305
|
+
ontologyPrimitive: "graph",
|
|
4306
|
+
tier: "workhorse"
|
|
4307
|
+
};
|
|
4308
|
+
var SEARCH_EMBEDDINGS = {
|
|
4309
|
+
name: "search_embeddings",
|
|
4310
|
+
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.",
|
|
4311
|
+
parameters: {
|
|
4312
|
+
...sharedEmbeddingParameters,
|
|
4313
|
+
queryText: {
|
|
4314
|
+
type: "string",
|
|
4315
|
+
description: "Natural-language query to embed and search with."
|
|
4316
|
+
},
|
|
4317
|
+
queryVector: {
|
|
4318
|
+
type: "array",
|
|
4319
|
+
description: "Optional precomputed query vector."
|
|
4320
|
+
},
|
|
4321
|
+
minScore: {
|
|
4322
|
+
type: "number",
|
|
4323
|
+
description: "Optional minimum cosine-similarity score."
|
|
4324
|
+
}
|
|
4325
|
+
},
|
|
4326
|
+
required: ["topicId", "workspaceId"],
|
|
4327
|
+
response: {
|
|
4328
|
+
description: "Vector search matches",
|
|
4329
|
+
fields: {
|
|
4330
|
+
results: "array \u2014 semantic matches with nodeId, nodeType, score, text, and provenance",
|
|
4331
|
+
total: "number \u2014 match count",
|
|
4332
|
+
nextCursor: "string | null"
|
|
4333
|
+
}
|
|
4334
|
+
},
|
|
4335
|
+
ownerModule: "reasoning-kernel",
|
|
4336
|
+
ontologyPrimitive: "graph",
|
|
4337
|
+
tier: "showcase"
|
|
4338
|
+
};
|
|
4339
|
+
var GET_EMBEDDINGS_BY_NODE_IDS = {
|
|
4340
|
+
name: "get_embeddings_by_node_ids",
|
|
4341
|
+
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.",
|
|
4342
|
+
parameters: {
|
|
4343
|
+
...sharedEmbeddingParameters,
|
|
4344
|
+
nodeIds: {
|
|
4345
|
+
type: "array",
|
|
4346
|
+
description: "Epistemic node IDs to inspect."
|
|
4347
|
+
}
|
|
4348
|
+
},
|
|
4349
|
+
required: ["topicId", "workspaceId", "nodeIds"],
|
|
4350
|
+
response: {
|
|
4351
|
+
description: "Embedding records for explicit node IDs",
|
|
4352
|
+
fields: {
|
|
4353
|
+
embeddings: "array \u2014 embedding metadata records",
|
|
4354
|
+
total: "number \u2014 embedding count",
|
|
4355
|
+
nextCursor: "string | null"
|
|
4356
|
+
}
|
|
4357
|
+
},
|
|
4358
|
+
ownerModule: "reasoning-kernel",
|
|
4359
|
+
ontologyPrimitive: "graph",
|
|
4360
|
+
tier: "workhorse"
|
|
4361
|
+
};
|
|
4362
|
+
var QUEUE_EMBEDDING_BACKFILL = {
|
|
4363
|
+
name: "queue_embedding_backfill",
|
|
4364
|
+
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.",
|
|
4365
|
+
parameters: {
|
|
4366
|
+
...sharedEmbeddingParameters,
|
|
4367
|
+
nodeIds: {
|
|
4368
|
+
type: "array",
|
|
4369
|
+
description: "Epistemic node IDs to queue for embedding generation."
|
|
4370
|
+
}
|
|
4371
|
+
},
|
|
4372
|
+
required: ["topicId", "workspaceId", "nodeIds"],
|
|
4373
|
+
response: {
|
|
4374
|
+
description: "Backfill queue receipt",
|
|
4375
|
+
fields: {
|
|
4376
|
+
queued: "number \u2014 queued node count",
|
|
4377
|
+
nodeIds: "array \u2014 node IDs queued for embedding generation"
|
|
4378
|
+
}
|
|
4379
|
+
},
|
|
4380
|
+
ownerModule: "reasoning-kernel",
|
|
4381
|
+
ontologyPrimitive: "graph",
|
|
4382
|
+
tier: "workhorse"
|
|
4383
|
+
};
|
|
4384
|
+
|
|
4385
|
+
// ../contracts/src/tool-contracts.hybrid-discovery.ts
|
|
4386
|
+
var hybridParameters = {
|
|
4387
|
+
query: {
|
|
4388
|
+
type: "string",
|
|
4389
|
+
description: "Natural-language query text to resolve against the typed reasoning graph."
|
|
4390
|
+
},
|
|
4391
|
+
queryText: {
|
|
4392
|
+
type: "string",
|
|
4393
|
+
description: "Explicit query text alias for clients that separate command words from search text."
|
|
4394
|
+
},
|
|
4395
|
+
text: {
|
|
4396
|
+
type: "string",
|
|
4397
|
+
description: "Raw pasted text to use as a semantic retrieval seed."
|
|
4398
|
+
},
|
|
4399
|
+
topicId: {
|
|
4400
|
+
type: "string",
|
|
4401
|
+
description: "Optional topic scope. When omitted, semantic topic candidates are resolved first."
|
|
4402
|
+
},
|
|
4403
|
+
workspaceId: {
|
|
4404
|
+
type: "string",
|
|
4405
|
+
description: "Optional workspace scope used by semantic topic candidates and vector search."
|
|
4406
|
+
},
|
|
4407
|
+
nodeId: {
|
|
4408
|
+
type: "string",
|
|
4409
|
+
description: "Optional source node used for related-node or impact analysis."
|
|
4410
|
+
},
|
|
4411
|
+
include: {
|
|
4412
|
+
type: "array",
|
|
4413
|
+
description: "Result families to include, such as topics, nodes, worktrees, tasks, evidence, and edges."
|
|
4414
|
+
},
|
|
4415
|
+
via: {
|
|
4416
|
+
type: "array",
|
|
4417
|
+
description: "Retrieval methods to use: bm25, embeddings, edges, topic-tree, state, graph-algorithms."
|
|
4418
|
+
},
|
|
4419
|
+
depth: {
|
|
4420
|
+
type: "number",
|
|
4421
|
+
description: "Graph expansion depth. Defaults to 1 and is capped by the server."
|
|
4422
|
+
},
|
|
4423
|
+
limit: {
|
|
4424
|
+
type: "number",
|
|
4425
|
+
description: "Maximum rows per result family."
|
|
4426
|
+
},
|
|
4427
|
+
minScore: {
|
|
4428
|
+
type: "number",
|
|
4429
|
+
description: "Minimum semantic or fused score for candidate rows."
|
|
4430
|
+
},
|
|
4431
|
+
campaign: {
|
|
4432
|
+
type: "number",
|
|
4433
|
+
description: "Optional worktree campaign filter."
|
|
4434
|
+
},
|
|
4435
|
+
lane: {
|
|
4436
|
+
type: "string",
|
|
4437
|
+
description: "Optional worktree lane filter."
|
|
4438
|
+
},
|
|
4439
|
+
status: {
|
|
4440
|
+
type: "string",
|
|
4441
|
+
description: "Optional node, task, or worktree state/status filter."
|
|
4442
|
+
},
|
|
4443
|
+
nodeTypes: {
|
|
4444
|
+
type: "array",
|
|
4445
|
+
description: "Optional epistemic node types to include."
|
|
4446
|
+
},
|
|
4447
|
+
changedPaths: {
|
|
4448
|
+
type: "array",
|
|
4449
|
+
description: "Changed file paths used as impact-analysis query signals."
|
|
4450
|
+
},
|
|
4451
|
+
metadata: {
|
|
4452
|
+
type: "object",
|
|
4453
|
+
description: "Optional planner metadata for receipts and caller provenance."
|
|
4454
|
+
}
|
|
4455
|
+
};
|
|
4456
|
+
var hybridResponse = {
|
|
4457
|
+
description: "Hybrid semantic graph planner response with ranked result families and retrieval receipt.",
|
|
4458
|
+
fields: {
|
|
4459
|
+
results: "array \u2014 ranked mixed graph results with score, kind, source, and ranking signals",
|
|
4460
|
+
topics: "array \u2014 candidate or traversed topics",
|
|
4461
|
+
nodes: "array \u2014 matching epistemic nodes",
|
|
4462
|
+
worktrees: "array \u2014 matching worktrees",
|
|
4463
|
+
tasks: "array \u2014 matching tasks",
|
|
4464
|
+
evidence: "array \u2014 matching evidence",
|
|
4465
|
+
edges: "array \u2014 graph neighborhood edges",
|
|
4466
|
+
receipt: "object \u2014 planner steps, candidate counts, ranking weights, source/cache posture"
|
|
4467
|
+
}
|
|
4468
|
+
};
|
|
4469
|
+
var HYBRID_DISCOVER = {
|
|
4470
|
+
name: "hybrid_discover",
|
|
4471
|
+
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.",
|
|
4472
|
+
parameters: hybridParameters,
|
|
4473
|
+
required: [],
|
|
4474
|
+
response: hybridResponse,
|
|
4475
|
+
ownerModule: "graph-intelligence",
|
|
4476
|
+
ontologyPrimitive: "graph",
|
|
4477
|
+
tier: "showcase"
|
|
4478
|
+
};
|
|
4479
|
+
var RESOLVE_TOPIC_SEMANTIC = {
|
|
4480
|
+
name: "resolve_topic_semantic",
|
|
4481
|
+
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.",
|
|
4482
|
+
parameters: hybridParameters,
|
|
4483
|
+
required: [],
|
|
4484
|
+
response: hybridResponse,
|
|
4485
|
+
ownerModule: "graph-intelligence",
|
|
4486
|
+
ontologyPrimitive: "graph",
|
|
4487
|
+
tier: "showcase"
|
|
4488
|
+
};
|
|
4489
|
+
var EXPAND_GRAPH_NEIGHBORHOOD = {
|
|
4490
|
+
name: "expand_graph_neighborhood",
|
|
4491
|
+
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.",
|
|
4492
|
+
parameters: hybridParameters,
|
|
4493
|
+
required: [],
|
|
4494
|
+
response: hybridResponse,
|
|
4495
|
+
ownerModule: "graph-intelligence",
|
|
4496
|
+
ontologyPrimitive: "graph",
|
|
4497
|
+
tier: "showcase"
|
|
4498
|
+
};
|
|
4499
|
+
var FIND_RELATED_NODES = {
|
|
4500
|
+
name: "find_related_nodes",
|
|
4501
|
+
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.",
|
|
4502
|
+
parameters: hybridParameters,
|
|
4503
|
+
required: [],
|
|
4504
|
+
response: hybridResponse,
|
|
4505
|
+
ownerModule: "graph-intelligence",
|
|
4506
|
+
ontologyPrimitive: "graph",
|
|
4507
|
+
tier: "showcase"
|
|
4508
|
+
};
|
|
4509
|
+
var ANALYZE_GRAPH_IMPACT = {
|
|
4510
|
+
name: "analyze_graph_impact",
|
|
4511
|
+
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.",
|
|
4512
|
+
parameters: hybridParameters,
|
|
4513
|
+
required: [],
|
|
4514
|
+
response: hybridResponse,
|
|
4515
|
+
ownerModule: "graph-intelligence",
|
|
4516
|
+
ontologyPrimitive: "graph",
|
|
4517
|
+
tier: "showcase"
|
|
4518
|
+
};
|
|
4519
|
+
var DETECT_GRAPH_DRIFT = {
|
|
4520
|
+
name: "detect_graph_drift",
|
|
4521
|
+
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.",
|
|
4522
|
+
parameters: hybridParameters,
|
|
4523
|
+
required: [],
|
|
4524
|
+
response: hybridResponse,
|
|
4525
|
+
ownerModule: "graph-intelligence",
|
|
4526
|
+
ontologyPrimitive: "graph",
|
|
4527
|
+
tier: "showcase"
|
|
4528
|
+
};
|
|
4529
|
+
|
|
4248
4530
|
// ../contracts/src/tool-contracts.ts
|
|
4249
4531
|
var MCP_TOOL_CONTRACTS = {
|
|
4250
4532
|
// Belief lifecycle (commit, amend, fork, archive)
|
|
@@ -4286,6 +4568,16 @@ var MCP_TOOL_CONTRACTS = {
|
|
|
4286
4568
|
search_beliefs: SEARCH_BELIEFS,
|
|
4287
4569
|
find_contradictions: FIND_CONTRADICTIONS,
|
|
4288
4570
|
bisect_confidence: BISECT_CONFIDENCE,
|
|
4571
|
+
list_missing_embeddings: LIST_MISSING_EMBEDDINGS,
|
|
4572
|
+
search_embeddings: SEARCH_EMBEDDINGS,
|
|
4573
|
+
get_embeddings_by_node_ids: GET_EMBEDDINGS_BY_NODE_IDS,
|
|
4574
|
+
queue_embedding_backfill: QUEUE_EMBEDDING_BACKFILL,
|
|
4575
|
+
hybrid_discover: HYBRID_DISCOVER,
|
|
4576
|
+
resolve_topic_semantic: RESOLVE_TOPIC_SEMANTIC,
|
|
4577
|
+
expand_graph_neighborhood: EXPAND_GRAPH_NEIGHBORHOOD,
|
|
4578
|
+
find_related_nodes: FIND_RELATED_NODES,
|
|
4579
|
+
analyze_graph_impact: ANALYZE_GRAPH_IMPACT,
|
|
4580
|
+
detect_graph_drift: DETECT_GRAPH_DRIFT,
|
|
4289
4581
|
// Edges (commit)
|
|
4290
4582
|
create_edge: CREATE_EDGE,
|
|
4291
4583
|
update_edge: UPDATE_EDGE,
|
|
@@ -6356,9 +6648,35 @@ defineTable({
|
|
|
6356
6648
|
category: "embedding",
|
|
6357
6649
|
shape: z.object({
|
|
6358
6650
|
"nodeId": idOf("epistemicNodes"),
|
|
6651
|
+
"tenantId": z.string().optional(),
|
|
6652
|
+
"workspaceId": z.string().optional(),
|
|
6359
6653
|
"topicId": z.string().optional(),
|
|
6360
|
-
"nodeType": z.enum([
|
|
6654
|
+
"nodeType": z.enum([
|
|
6655
|
+
"decision",
|
|
6656
|
+
"belief",
|
|
6657
|
+
"question",
|
|
6658
|
+
"theme",
|
|
6659
|
+
"deal",
|
|
6660
|
+
"topic",
|
|
6661
|
+
"claim",
|
|
6662
|
+
"evidence",
|
|
6663
|
+
"synthesis",
|
|
6664
|
+
"answer",
|
|
6665
|
+
"atomic_fact",
|
|
6666
|
+
"excerpt",
|
|
6667
|
+
"source",
|
|
6668
|
+
"company",
|
|
6669
|
+
"person",
|
|
6670
|
+
"investor",
|
|
6671
|
+
"function",
|
|
6672
|
+
"value_chain"
|
|
6673
|
+
]),
|
|
6361
6674
|
"embedding": z.array(z.number()),
|
|
6675
|
+
"embeddingModel": z.string().optional(),
|
|
6676
|
+
"vectorDimensions": z.number().optional(),
|
|
6677
|
+
"contentHash": z.string().optional(),
|
|
6678
|
+
"textPreview": z.string().optional(),
|
|
6679
|
+
"embeddedAt": z.number().optional(),
|
|
6362
6680
|
"createdBy": z.string(),
|
|
6363
6681
|
"hasAnswer": z.boolean().optional(),
|
|
6364
6682
|
"confidence": z.number().optional(),
|
|
@@ -6368,9 +6686,10 @@ defineTable({
|
|
|
6368
6686
|
}),
|
|
6369
6687
|
indices: [
|
|
6370
6688
|
{ kind: "index", name: "by_nodeId", columns: ["nodeId"] },
|
|
6689
|
+
{ kind: "index", name: "by_topicId_nodeId", columns: ["topicId", "nodeId"] },
|
|
6371
6690
|
{ kind: "index", name: "by_topicId_type", columns: ["topicId", "nodeType"] },
|
|
6372
6691
|
{ kind: "index", name: "by_topicId", columns: ["topicId"] },
|
|
6373
|
-
{ kind: "vector", name: "by_embedding", vectorField: "embedding", dimensions: 1024, filterFields: ["nodeType", "createdBy"] }
|
|
6692
|
+
{ kind: "vector", name: "by_embedding", vectorField: "embedding", dimensions: 1024, filterFields: ["nodeType", "createdBy", "topicId"] }
|
|
6374
6693
|
]
|
|
6375
6694
|
});
|
|
6376
6695
|
defineTable({
|
|
@@ -11619,6 +11938,16 @@ var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
|
|
|
11619
11938
|
"get_graph_structure_analysis",
|
|
11620
11939
|
"list_graph_intelligence_queries",
|
|
11621
11940
|
"run_graph_intelligence_query",
|
|
11941
|
+
"list_missing_embeddings",
|
|
11942
|
+
"search_embeddings",
|
|
11943
|
+
"get_embeddings_by_node_ids",
|
|
11944
|
+
"queue_embedding_backfill",
|
|
11945
|
+
"hybrid_discover",
|
|
11946
|
+
"resolve_topic_semantic",
|
|
11947
|
+
"expand_graph_neighborhood",
|
|
11948
|
+
"find_related_nodes",
|
|
11949
|
+
"analyze_graph_impact",
|
|
11950
|
+
"detect_graph_drift",
|
|
11622
11951
|
"find_contradictions",
|
|
11623
11952
|
"flag_contradiction",
|
|
11624
11953
|
"detect_confirmation_bias",
|
|
@@ -13538,14 +13867,14 @@ function resolveCanonicalText(input) {
|
|
|
13538
13867
|
}
|
|
13539
13868
|
function createNodeInput(input, context) {
|
|
13540
13869
|
const canonicalText = resolveCanonicalText(input);
|
|
13541
|
-
const
|
|
13870
|
+
const nodeType2 = String(input.nodeType);
|
|
13542
13871
|
return withCreatedBy(
|
|
13543
13872
|
compactRecord4({
|
|
13544
|
-
globalId: typeof input.globalId === "string" && input.globalId.trim() ? input.globalId : generatedGlobalId(
|
|
13545
|
-
nodeType,
|
|
13873
|
+
globalId: typeof input.globalId === "string" && input.globalId.trim() ? input.globalId : generatedGlobalId(nodeType2),
|
|
13874
|
+
nodeType: nodeType2,
|
|
13546
13875
|
subtype: input.subtype,
|
|
13547
13876
|
canonicalText,
|
|
13548
|
-
contentHash: typeof input.contentHash === "string" && input.contentHash.trim() ? input.contentHash : `${
|
|
13877
|
+
contentHash: typeof input.contentHash === "string" && input.contentHash.trim() ? input.contentHash : `${nodeType2}:${canonicalText}`,
|
|
13549
13878
|
content: input.content,
|
|
13550
13879
|
contentType: input.contentType,
|
|
13551
13880
|
title: input.title,
|
|
@@ -15296,6 +15625,208 @@ var graphContracts = [
|
|
|
15296
15625
|
args: lineageArgs
|
|
15297
15626
|
})
|
|
15298
15627
|
];
|
|
15628
|
+
var nodeType = z.string().optional().describe("Optional epistemic node type filter.");
|
|
15629
|
+
var embeddingScopeArgs = z.object({
|
|
15630
|
+
topicId: z.string().describe("Topic scope for the embedding operation."),
|
|
15631
|
+
workspaceId: z.string().optional().describe("Workspace scope for the embedding operation."),
|
|
15632
|
+
nodeType,
|
|
15633
|
+
embeddingModel: z.string().optional().describe("Optional embedding model filter."),
|
|
15634
|
+
limit: z.number().optional().describe("Maximum rows to return."),
|
|
15635
|
+
cursor: z.string().optional().describe("Pagination cursor.")
|
|
15636
|
+
});
|
|
15637
|
+
var searchEmbeddingsArgs = embeddingScopeArgs.extend({
|
|
15638
|
+
queryText: z.string().optional().describe("Natural-language query to embed and search with."),
|
|
15639
|
+
queryVector: z.array(z.number()).optional().describe("Optional precomputed query vector."),
|
|
15640
|
+
minScore: z.number().optional().describe("Minimum vector score.")
|
|
15641
|
+
});
|
|
15642
|
+
var getEmbeddingsArgs = embeddingScopeArgs.extend({
|
|
15643
|
+
nodeIds: z.array(z.string()).describe("Epistemic node IDs to inspect.")
|
|
15644
|
+
});
|
|
15645
|
+
var queueEmbeddingBackfillArgs = getEmbeddingsArgs.extend({
|
|
15646
|
+
metadata: z.record(z.unknown()).optional().describe("Backfill scheduling metadata.")
|
|
15647
|
+
});
|
|
15648
|
+
var passthroughInput = (input) => compactRecord4(input);
|
|
15649
|
+
var embeddingsContracts = [
|
|
15650
|
+
surfaceContract({
|
|
15651
|
+
name: "list_missing_embeddings",
|
|
15652
|
+
kind: "query",
|
|
15653
|
+
domain: "embeddings",
|
|
15654
|
+
surfaceClass: "platform_public",
|
|
15655
|
+
method: "GET",
|
|
15656
|
+
path: "/embeddings/missing",
|
|
15657
|
+
sdkNamespace: "embeddings",
|
|
15658
|
+
sdkMethod: "listMissingForTopic",
|
|
15659
|
+
summary: "List epistemic nodes missing fresh Convex embeddings.",
|
|
15660
|
+
convex: {
|
|
15661
|
+
module: "embeddings",
|
|
15662
|
+
functionName: "listMissingForTopic",
|
|
15663
|
+
kind: "query",
|
|
15664
|
+
inputProjection: passthroughInput
|
|
15665
|
+
},
|
|
15666
|
+
args: embeddingScopeArgs
|
|
15667
|
+
}),
|
|
15668
|
+
surfaceContract({
|
|
15669
|
+
name: "search_embeddings",
|
|
15670
|
+
kind: "action",
|
|
15671
|
+
domain: "embeddings",
|
|
15672
|
+
surfaceClass: "platform_public",
|
|
15673
|
+
path: "/embeddings/vector-search",
|
|
15674
|
+
sdkNamespace: "embeddings",
|
|
15675
|
+
sdkMethod: "vectorSearchByTopic",
|
|
15676
|
+
summary: "Search topic-scoped epistemic nodes through the Convex vector index.",
|
|
15677
|
+
idempotent: false,
|
|
15678
|
+
effects: ["read"],
|
|
15679
|
+
scopes: ["embeddings.read"],
|
|
15680
|
+
convex: {
|
|
15681
|
+
module: "embeddings",
|
|
15682
|
+
functionName: "vectorSearchByTopic",
|
|
15683
|
+
kind: "action",
|
|
15684
|
+
inputProjection: passthroughInput
|
|
15685
|
+
},
|
|
15686
|
+
args: searchEmbeddingsArgs
|
|
15687
|
+
}),
|
|
15688
|
+
surfaceContract({
|
|
15689
|
+
name: "get_embeddings_by_node_ids",
|
|
15690
|
+
kind: "query",
|
|
15691
|
+
domain: "embeddings",
|
|
15692
|
+
surfaceClass: "platform_public",
|
|
15693
|
+
path: "/embeddings/by-node-ids",
|
|
15694
|
+
sdkNamespace: "embeddings",
|
|
15695
|
+
sdkMethod: "getByNodeIds",
|
|
15696
|
+
summary: "Fetch embedding records for explicit epistemic node IDs.",
|
|
15697
|
+
convex: {
|
|
15698
|
+
module: "embeddings",
|
|
15699
|
+
functionName: "getByNodeIds",
|
|
15700
|
+
kind: "query",
|
|
15701
|
+
inputProjection: passthroughInput
|
|
15702
|
+
},
|
|
15703
|
+
args: getEmbeddingsArgs
|
|
15704
|
+
}),
|
|
15705
|
+
surfaceContract({
|
|
15706
|
+
name: "queue_embedding_backfill",
|
|
15707
|
+
kind: "mutation",
|
|
15708
|
+
domain: "embeddings",
|
|
15709
|
+
surfaceClass: "platform_public",
|
|
15710
|
+
path: "/embeddings/backfill-queued",
|
|
15711
|
+
sdkNamespace: "embeddings",
|
|
15712
|
+
sdkMethod: "markEmbeddingBackfillQueued",
|
|
15713
|
+
summary: "Queue background embedding generation for explicit epistemic nodes.",
|
|
15714
|
+
convex: {
|
|
15715
|
+
module: "embeddings",
|
|
15716
|
+
functionName: "markEmbeddingBackfillQueued",
|
|
15717
|
+
kind: "mutation",
|
|
15718
|
+
inputProjection: passthroughInput
|
|
15719
|
+
},
|
|
15720
|
+
args: queueEmbeddingBackfillArgs
|
|
15721
|
+
})
|
|
15722
|
+
];
|
|
15723
|
+
var includeKindSchema = z.enum([
|
|
15724
|
+
"topics",
|
|
15725
|
+
"nodes",
|
|
15726
|
+
"worktrees",
|
|
15727
|
+
"tasks",
|
|
15728
|
+
"evidence",
|
|
15729
|
+
"edges"
|
|
15730
|
+
]);
|
|
15731
|
+
var viaKindSchema = z.enum([
|
|
15732
|
+
"bm25",
|
|
15733
|
+
"embeddings",
|
|
15734
|
+
"edges",
|
|
15735
|
+
"topic-tree",
|
|
15736
|
+
"state",
|
|
15737
|
+
"graph-algorithms"
|
|
15738
|
+
]);
|
|
15739
|
+
var hybridPlannerArgs = z.object({
|
|
15740
|
+
query: z.string().optional().describe("Natural-language query text."),
|
|
15741
|
+
queryText: z.string().optional().describe("Explicit query text alias."),
|
|
15742
|
+
text: z.string().optional().describe("Raw pasted text to use as query input."),
|
|
15743
|
+
topicId: z.string().optional().describe("Optional topic scope."),
|
|
15744
|
+
workspaceId: z.string().optional().describe("Optional workspace scope."),
|
|
15745
|
+
nodeId: z.string().optional().describe("Optional source node."),
|
|
15746
|
+
include: z.array(includeKindSchema).optional().describe("Result families to include."),
|
|
15747
|
+
via: z.array(viaKindSchema).optional().describe("Retrieval methods to use."),
|
|
15748
|
+
depth: z.number().optional().describe("Graph expansion depth."),
|
|
15749
|
+
limit: z.number().optional().describe("Maximum rows per result family."),
|
|
15750
|
+
minScore: z.number().optional().describe("Minimum fused score."),
|
|
15751
|
+
campaign: z.number().optional().describe("Optional worktree campaign filter."),
|
|
15752
|
+
lane: z.string().optional().describe("Optional worktree lane filter."),
|
|
15753
|
+
status: z.string().optional().describe("Optional state/status filter."),
|
|
15754
|
+
nodeType: z.string().optional().describe("Single node type filter."),
|
|
15755
|
+
nodeTypes: z.array(z.string()).optional().describe("Node type filters."),
|
|
15756
|
+
changedPaths: z.array(z.string()).optional().describe("Changed file path signals."),
|
|
15757
|
+
metadata: z.record(z.unknown()).optional().describe("Planner metadata.")
|
|
15758
|
+
});
|
|
15759
|
+
var modeInput = (mode) => (input) => compactRecord4({
|
|
15760
|
+
...input,
|
|
15761
|
+
mode,
|
|
15762
|
+
queryText: input.queryText ?? input.query ?? input.text
|
|
15763
|
+
});
|
|
15764
|
+
function hybridContract(args) {
|
|
15765
|
+
return surfaceContract({
|
|
15766
|
+
name: args.name,
|
|
15767
|
+
kind: "action",
|
|
15768
|
+
domain: "hybrid",
|
|
15769
|
+
surfaceClass: "platform_public",
|
|
15770
|
+
path: args.path,
|
|
15771
|
+
sdkNamespace: "hybrid",
|
|
15772
|
+
sdkMethod: args.sdkMethod,
|
|
15773
|
+
summary: args.summary,
|
|
15774
|
+
idempotent: false,
|
|
15775
|
+
effects: ["read"],
|
|
15776
|
+
scopes: ["hybrid.read"],
|
|
15777
|
+
convex: {
|
|
15778
|
+
module: "hybridDiscovery",
|
|
15779
|
+
functionName: args.sdkMethod,
|
|
15780
|
+
kind: "action",
|
|
15781
|
+
inputProjection: modeInput(args.mode)
|
|
15782
|
+
},
|
|
15783
|
+
args: hybridPlannerArgs
|
|
15784
|
+
});
|
|
15785
|
+
}
|
|
15786
|
+
var hybridContracts = [
|
|
15787
|
+
hybridContract({
|
|
15788
|
+
name: "hybrid_discover",
|
|
15789
|
+
path: "/hybrid/discover",
|
|
15790
|
+
sdkMethod: "hybridDiscover",
|
|
15791
|
+
summary: "Discover typed graph context with BM25, embeddings, topic tree traversal, and graph neighborhoods.",
|
|
15792
|
+
mode: "discover"
|
|
15793
|
+
}),
|
|
15794
|
+
hybridContract({
|
|
15795
|
+
name: "resolve_topic_semantic",
|
|
15796
|
+
path: "/hybrid/topics/resolve",
|
|
15797
|
+
sdkMethod: "resolveTopicSemantic",
|
|
15798
|
+
summary: "Resolve an ambiguous topic using BM25, vector candidates, and topic-tree context.",
|
|
15799
|
+
mode: "resolve_topic"
|
|
15800
|
+
}),
|
|
15801
|
+
hybridContract({
|
|
15802
|
+
name: "expand_graph_neighborhood",
|
|
15803
|
+
path: "/hybrid/neighborhood",
|
|
15804
|
+
sdkMethod: "expandGraphNeighborhood",
|
|
15805
|
+
summary: "Expand a typed graph neighborhood around a query, topic, or node.",
|
|
15806
|
+
mode: "neighborhood"
|
|
15807
|
+
}),
|
|
15808
|
+
hybridContract({
|
|
15809
|
+
name: "find_related_nodes",
|
|
15810
|
+
path: "/hybrid/related-nodes",
|
|
15811
|
+
sdkMethod: "findRelatedNodes",
|
|
15812
|
+
summary: "Find semantically and structurally related nodes across the reasoning graph.",
|
|
15813
|
+
mode: "related_nodes"
|
|
15814
|
+
}),
|
|
15815
|
+
hybridContract({
|
|
15816
|
+
name: "analyze_graph_impact",
|
|
15817
|
+
path: "/hybrid/impact",
|
|
15818
|
+
sdkMethod: "analyzeGraphImpact",
|
|
15819
|
+
summary: "Analyze which graph objects are affected by files, PR text, incidents, or campaign objectives.",
|
|
15820
|
+
mode: "impact"
|
|
15821
|
+
}),
|
|
15822
|
+
hybridContract({
|
|
15823
|
+
name: "detect_graph_drift",
|
|
15824
|
+
path: "/hybrid/drift",
|
|
15825
|
+
sdkMethod: "detectGraphDrift",
|
|
15826
|
+
summary: "Detect duplicate, stale, orphaned, or weakly linked reasoning graph surface.",
|
|
15827
|
+
mode: "drift"
|
|
15828
|
+
})
|
|
15829
|
+
];
|
|
15299
15830
|
|
|
15300
15831
|
// ../contracts/src/function-registry/contracts.ts
|
|
15301
15832
|
var contractsContracts = [
|
|
@@ -15968,6 +16499,8 @@ var ALL_FUNCTION_CONTRACTS = [
|
|
|
15968
16499
|
...tasksContracts,
|
|
15969
16500
|
...edgesContracts,
|
|
15970
16501
|
...graphContracts,
|
|
16502
|
+
...embeddingsContracts,
|
|
16503
|
+
...hybridContracts,
|
|
15971
16504
|
...contractsContracts,
|
|
15972
16505
|
...judgmentsContracts,
|
|
15973
16506
|
...coordinationContracts,
|