@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/outbox.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({
|
|
@@ -11671,6 +11990,16 @@ var MCP_ANALYSIS_PLATFORM_OPERATION_NAMES = [
|
|
|
11671
11990
|
"get_graph_structure_analysis",
|
|
11672
11991
|
"list_graph_intelligence_queries",
|
|
11673
11992
|
"run_graph_intelligence_query",
|
|
11993
|
+
"list_missing_embeddings",
|
|
11994
|
+
"search_embeddings",
|
|
11995
|
+
"get_embeddings_by_node_ids",
|
|
11996
|
+
"queue_embedding_backfill",
|
|
11997
|
+
"hybrid_discover",
|
|
11998
|
+
"resolve_topic_semantic",
|
|
11999
|
+
"expand_graph_neighborhood",
|
|
12000
|
+
"find_related_nodes",
|
|
12001
|
+
"analyze_graph_impact",
|
|
12002
|
+
"detect_graph_drift",
|
|
11674
12003
|
"find_contradictions",
|
|
11675
12004
|
"flag_contradiction",
|
|
11676
12005
|
"detect_confirmation_bias",
|
|
@@ -13590,14 +13919,14 @@ function resolveCanonicalText(input) {
|
|
|
13590
13919
|
}
|
|
13591
13920
|
function createNodeInput(input, context) {
|
|
13592
13921
|
const canonicalText = resolveCanonicalText(input);
|
|
13593
|
-
const
|
|
13922
|
+
const nodeType2 = String(input.nodeType);
|
|
13594
13923
|
return withCreatedBy(
|
|
13595
13924
|
compactRecord4({
|
|
13596
|
-
globalId: typeof input.globalId === "string" && input.globalId.trim() ? input.globalId : generatedGlobalId(
|
|
13597
|
-
nodeType,
|
|
13925
|
+
globalId: typeof input.globalId === "string" && input.globalId.trim() ? input.globalId : generatedGlobalId(nodeType2),
|
|
13926
|
+
nodeType: nodeType2,
|
|
13598
13927
|
subtype: input.subtype,
|
|
13599
13928
|
canonicalText,
|
|
13600
|
-
contentHash: typeof input.contentHash === "string" && input.contentHash.trim() ? input.contentHash : `${
|
|
13929
|
+
contentHash: typeof input.contentHash === "string" && input.contentHash.trim() ? input.contentHash : `${nodeType2}:${canonicalText}`,
|
|
13601
13930
|
content: input.content,
|
|
13602
13931
|
contentType: input.contentType,
|
|
13603
13932
|
title: input.title,
|
|
@@ -15348,6 +15677,208 @@ var graphContracts = [
|
|
|
15348
15677
|
args: lineageArgs
|
|
15349
15678
|
})
|
|
15350
15679
|
];
|
|
15680
|
+
var nodeType = z.string().optional().describe("Optional epistemic node type filter.");
|
|
15681
|
+
var embeddingScopeArgs = z.object({
|
|
15682
|
+
topicId: z.string().describe("Topic scope for the embedding operation."),
|
|
15683
|
+
workspaceId: z.string().optional().describe("Workspace scope for the embedding operation."),
|
|
15684
|
+
nodeType,
|
|
15685
|
+
embeddingModel: z.string().optional().describe("Optional embedding model filter."),
|
|
15686
|
+
limit: z.number().optional().describe("Maximum rows to return."),
|
|
15687
|
+
cursor: z.string().optional().describe("Pagination cursor.")
|
|
15688
|
+
});
|
|
15689
|
+
var searchEmbeddingsArgs = embeddingScopeArgs.extend({
|
|
15690
|
+
queryText: z.string().optional().describe("Natural-language query to embed and search with."),
|
|
15691
|
+
queryVector: z.array(z.number()).optional().describe("Optional precomputed query vector."),
|
|
15692
|
+
minScore: z.number().optional().describe("Minimum vector score.")
|
|
15693
|
+
});
|
|
15694
|
+
var getEmbeddingsArgs = embeddingScopeArgs.extend({
|
|
15695
|
+
nodeIds: z.array(z.string()).describe("Epistemic node IDs to inspect.")
|
|
15696
|
+
});
|
|
15697
|
+
var queueEmbeddingBackfillArgs = getEmbeddingsArgs.extend({
|
|
15698
|
+
metadata: z.record(z.unknown()).optional().describe("Backfill scheduling metadata.")
|
|
15699
|
+
});
|
|
15700
|
+
var passthroughInput = (input) => compactRecord4(input);
|
|
15701
|
+
var embeddingsContracts = [
|
|
15702
|
+
surfaceContract({
|
|
15703
|
+
name: "list_missing_embeddings",
|
|
15704
|
+
kind: "query",
|
|
15705
|
+
domain: "embeddings",
|
|
15706
|
+
surfaceClass: "platform_public",
|
|
15707
|
+
method: "GET",
|
|
15708
|
+
path: "/embeddings/missing",
|
|
15709
|
+
sdkNamespace: "embeddings",
|
|
15710
|
+
sdkMethod: "listMissingForTopic",
|
|
15711
|
+
summary: "List epistemic nodes missing fresh Convex embeddings.",
|
|
15712
|
+
convex: {
|
|
15713
|
+
module: "embeddings",
|
|
15714
|
+
functionName: "listMissingForTopic",
|
|
15715
|
+
kind: "query",
|
|
15716
|
+
inputProjection: passthroughInput
|
|
15717
|
+
},
|
|
15718
|
+
args: embeddingScopeArgs
|
|
15719
|
+
}),
|
|
15720
|
+
surfaceContract({
|
|
15721
|
+
name: "search_embeddings",
|
|
15722
|
+
kind: "action",
|
|
15723
|
+
domain: "embeddings",
|
|
15724
|
+
surfaceClass: "platform_public",
|
|
15725
|
+
path: "/embeddings/vector-search",
|
|
15726
|
+
sdkNamespace: "embeddings",
|
|
15727
|
+
sdkMethod: "vectorSearchByTopic",
|
|
15728
|
+
summary: "Search topic-scoped epistemic nodes through the Convex vector index.",
|
|
15729
|
+
idempotent: false,
|
|
15730
|
+
effects: ["read"],
|
|
15731
|
+
scopes: ["embeddings.read"],
|
|
15732
|
+
convex: {
|
|
15733
|
+
module: "embeddings",
|
|
15734
|
+
functionName: "vectorSearchByTopic",
|
|
15735
|
+
kind: "action",
|
|
15736
|
+
inputProjection: passthroughInput
|
|
15737
|
+
},
|
|
15738
|
+
args: searchEmbeddingsArgs
|
|
15739
|
+
}),
|
|
15740
|
+
surfaceContract({
|
|
15741
|
+
name: "get_embeddings_by_node_ids",
|
|
15742
|
+
kind: "query",
|
|
15743
|
+
domain: "embeddings",
|
|
15744
|
+
surfaceClass: "platform_public",
|
|
15745
|
+
path: "/embeddings/by-node-ids",
|
|
15746
|
+
sdkNamespace: "embeddings",
|
|
15747
|
+
sdkMethod: "getByNodeIds",
|
|
15748
|
+
summary: "Fetch embedding records for explicit epistemic node IDs.",
|
|
15749
|
+
convex: {
|
|
15750
|
+
module: "embeddings",
|
|
15751
|
+
functionName: "getByNodeIds",
|
|
15752
|
+
kind: "query",
|
|
15753
|
+
inputProjection: passthroughInput
|
|
15754
|
+
},
|
|
15755
|
+
args: getEmbeddingsArgs
|
|
15756
|
+
}),
|
|
15757
|
+
surfaceContract({
|
|
15758
|
+
name: "queue_embedding_backfill",
|
|
15759
|
+
kind: "mutation",
|
|
15760
|
+
domain: "embeddings",
|
|
15761
|
+
surfaceClass: "platform_public",
|
|
15762
|
+
path: "/embeddings/backfill-queued",
|
|
15763
|
+
sdkNamespace: "embeddings",
|
|
15764
|
+
sdkMethod: "markEmbeddingBackfillQueued",
|
|
15765
|
+
summary: "Queue background embedding generation for explicit epistemic nodes.",
|
|
15766
|
+
convex: {
|
|
15767
|
+
module: "embeddings",
|
|
15768
|
+
functionName: "markEmbeddingBackfillQueued",
|
|
15769
|
+
kind: "mutation",
|
|
15770
|
+
inputProjection: passthroughInput
|
|
15771
|
+
},
|
|
15772
|
+
args: queueEmbeddingBackfillArgs
|
|
15773
|
+
})
|
|
15774
|
+
];
|
|
15775
|
+
var includeKindSchema = z.enum([
|
|
15776
|
+
"topics",
|
|
15777
|
+
"nodes",
|
|
15778
|
+
"worktrees",
|
|
15779
|
+
"tasks",
|
|
15780
|
+
"evidence",
|
|
15781
|
+
"edges"
|
|
15782
|
+
]);
|
|
15783
|
+
var viaKindSchema = z.enum([
|
|
15784
|
+
"bm25",
|
|
15785
|
+
"embeddings",
|
|
15786
|
+
"edges",
|
|
15787
|
+
"topic-tree",
|
|
15788
|
+
"state",
|
|
15789
|
+
"graph-algorithms"
|
|
15790
|
+
]);
|
|
15791
|
+
var hybridPlannerArgs = z.object({
|
|
15792
|
+
query: z.string().optional().describe("Natural-language query text."),
|
|
15793
|
+
queryText: z.string().optional().describe("Explicit query text alias."),
|
|
15794
|
+
text: z.string().optional().describe("Raw pasted text to use as query input."),
|
|
15795
|
+
topicId: z.string().optional().describe("Optional topic scope."),
|
|
15796
|
+
workspaceId: z.string().optional().describe("Optional workspace scope."),
|
|
15797
|
+
nodeId: z.string().optional().describe("Optional source node."),
|
|
15798
|
+
include: z.array(includeKindSchema).optional().describe("Result families to include."),
|
|
15799
|
+
via: z.array(viaKindSchema).optional().describe("Retrieval methods to use."),
|
|
15800
|
+
depth: z.number().optional().describe("Graph expansion depth."),
|
|
15801
|
+
limit: z.number().optional().describe("Maximum rows per result family."),
|
|
15802
|
+
minScore: z.number().optional().describe("Minimum fused score."),
|
|
15803
|
+
campaign: z.number().optional().describe("Optional worktree campaign filter."),
|
|
15804
|
+
lane: z.string().optional().describe("Optional worktree lane filter."),
|
|
15805
|
+
status: z.string().optional().describe("Optional state/status filter."),
|
|
15806
|
+
nodeType: z.string().optional().describe("Single node type filter."),
|
|
15807
|
+
nodeTypes: z.array(z.string()).optional().describe("Node type filters."),
|
|
15808
|
+
changedPaths: z.array(z.string()).optional().describe("Changed file path signals."),
|
|
15809
|
+
metadata: z.record(z.unknown()).optional().describe("Planner metadata.")
|
|
15810
|
+
});
|
|
15811
|
+
var modeInput = (mode) => (input) => compactRecord4({
|
|
15812
|
+
...input,
|
|
15813
|
+
mode,
|
|
15814
|
+
queryText: input.queryText ?? input.query ?? input.text
|
|
15815
|
+
});
|
|
15816
|
+
function hybridContract(args) {
|
|
15817
|
+
return surfaceContract({
|
|
15818
|
+
name: args.name,
|
|
15819
|
+
kind: "action",
|
|
15820
|
+
domain: "hybrid",
|
|
15821
|
+
surfaceClass: "platform_public",
|
|
15822
|
+
path: args.path,
|
|
15823
|
+
sdkNamespace: "hybrid",
|
|
15824
|
+
sdkMethod: args.sdkMethod,
|
|
15825
|
+
summary: args.summary,
|
|
15826
|
+
idempotent: false,
|
|
15827
|
+
effects: ["read"],
|
|
15828
|
+
scopes: ["hybrid.read"],
|
|
15829
|
+
convex: {
|
|
15830
|
+
module: "hybridDiscovery",
|
|
15831
|
+
functionName: args.sdkMethod,
|
|
15832
|
+
kind: "action",
|
|
15833
|
+
inputProjection: modeInput(args.mode)
|
|
15834
|
+
},
|
|
15835
|
+
args: hybridPlannerArgs
|
|
15836
|
+
});
|
|
15837
|
+
}
|
|
15838
|
+
var hybridContracts = [
|
|
15839
|
+
hybridContract({
|
|
15840
|
+
name: "hybrid_discover",
|
|
15841
|
+
path: "/hybrid/discover",
|
|
15842
|
+
sdkMethod: "hybridDiscover",
|
|
15843
|
+
summary: "Discover typed graph context with BM25, embeddings, topic tree traversal, and graph neighborhoods.",
|
|
15844
|
+
mode: "discover"
|
|
15845
|
+
}),
|
|
15846
|
+
hybridContract({
|
|
15847
|
+
name: "resolve_topic_semantic",
|
|
15848
|
+
path: "/hybrid/topics/resolve",
|
|
15849
|
+
sdkMethod: "resolveTopicSemantic",
|
|
15850
|
+
summary: "Resolve an ambiguous topic using BM25, vector candidates, and topic-tree context.",
|
|
15851
|
+
mode: "resolve_topic"
|
|
15852
|
+
}),
|
|
15853
|
+
hybridContract({
|
|
15854
|
+
name: "expand_graph_neighborhood",
|
|
15855
|
+
path: "/hybrid/neighborhood",
|
|
15856
|
+
sdkMethod: "expandGraphNeighborhood",
|
|
15857
|
+
summary: "Expand a typed graph neighborhood around a query, topic, or node.",
|
|
15858
|
+
mode: "neighborhood"
|
|
15859
|
+
}),
|
|
15860
|
+
hybridContract({
|
|
15861
|
+
name: "find_related_nodes",
|
|
15862
|
+
path: "/hybrid/related-nodes",
|
|
15863
|
+
sdkMethod: "findRelatedNodes",
|
|
15864
|
+
summary: "Find semantically and structurally related nodes across the reasoning graph.",
|
|
15865
|
+
mode: "related_nodes"
|
|
15866
|
+
}),
|
|
15867
|
+
hybridContract({
|
|
15868
|
+
name: "analyze_graph_impact",
|
|
15869
|
+
path: "/hybrid/impact",
|
|
15870
|
+
sdkMethod: "analyzeGraphImpact",
|
|
15871
|
+
summary: "Analyze which graph objects are affected by files, PR text, incidents, or campaign objectives.",
|
|
15872
|
+
mode: "impact"
|
|
15873
|
+
}),
|
|
15874
|
+
hybridContract({
|
|
15875
|
+
name: "detect_graph_drift",
|
|
15876
|
+
path: "/hybrid/drift",
|
|
15877
|
+
sdkMethod: "detectGraphDrift",
|
|
15878
|
+
summary: "Detect duplicate, stale, orphaned, or weakly linked reasoning graph surface.",
|
|
15879
|
+
mode: "drift"
|
|
15880
|
+
})
|
|
15881
|
+
];
|
|
15351
15882
|
|
|
15352
15883
|
// ../contracts/src/function-registry/contracts.ts
|
|
15353
15884
|
var contractsContracts = [
|
|
@@ -16020,6 +16551,8 @@ var ALL_FUNCTION_CONTRACTS = [
|
|
|
16020
16551
|
...tasksContracts,
|
|
16021
16552
|
...edgesContracts,
|
|
16022
16553
|
...graphContracts,
|
|
16554
|
+
...embeddingsContracts,
|
|
16555
|
+
...hybridContracts,
|
|
16023
16556
|
...contractsContracts,
|
|
16024
16557
|
...judgmentsContracts,
|
|
16025
16558
|
...coordinationContracts,
|