@lucern/contracts 0.3.0-alpha.10 → 0.3.0-alpha.11
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/api-enums.contract.d.ts +5 -3
- package/dist/api-enums.contract.js +14 -12
- package/dist/api-enums.contract.js.map +1 -1
- package/dist/component-boundary.contract.d.ts +1 -1
- package/dist/component-boundary.contract.js +45 -26
- package/dist/component-boundary.contract.js.map +1 -1
- package/dist/component-host-boundary.contract.d.ts +10 -5
- package/dist/component-host-boundary.contract.js +10 -4
- package/dist/component-host-boundary.contract.js.map +1 -1
- package/dist/{defineTable-CBQ03FXl.d.ts → defineTable-t1wr5wgn.d.ts} +1 -1
- package/dist/{dsl-djCRfuWC.d.ts → dsl-DVPthQGY.d.ts} +1 -1
- package/dist/dsl.d.ts +2 -2
- package/dist/dsl.js.map +1 -1
- package/dist/function-registry/beliefs.d.ts +13 -0
- package/dist/function-registry/beliefs.js +50 -7
- package/dist/function-registry/beliefs.js.map +1 -1
- package/dist/function-registry/coding.d.ts +9 -0
- package/dist/function-registry/coding.js +117 -8
- package/dist/function-registry/coding.js.map +1 -1
- package/dist/function-registry/context.d.ts +6 -0
- package/dist/function-registry/context.js +50 -7
- package/dist/function-registry/context.js.map +1 -1
- package/dist/function-registry/contracts.d.ts +6 -0
- package/dist/function-registry/contracts.js +50 -7
- package/dist/function-registry/contracts.js.map +1 -1
- package/dist/function-registry/coordination.d.ts +12 -0
- package/dist/function-registry/coordination.js +50 -7
- package/dist/function-registry/coordination.js.map +1 -1
- package/dist/function-registry/edges.d.ts +9 -0
- package/dist/function-registry/edges.js +54 -14
- package/dist/function-registry/edges.js.map +1 -1
- package/dist/function-registry/evidence.d.ts +11 -0
- package/dist/function-registry/evidence.js +53 -11
- package/dist/function-registry/evidence.js.map +1 -1
- package/dist/function-registry/graph.d.ts +18 -0
- package/dist/function-registry/graph.js +50 -7
- package/dist/function-registry/graph.js.map +1 -1
- package/dist/function-registry/helpers.d.ts +4 -1
- package/dist/function-registry/helpers.js +51 -8
- package/dist/function-registry/helpers.js.map +1 -1
- package/dist/function-registry/identity.d.ts +6 -0
- package/dist/function-registry/identity.js +50 -7
- package/dist/function-registry/identity.js.map +1 -1
- package/dist/function-registry/index.d.ts +8 -320
- package/dist/function-registry/index.js +54 -384
- package/dist/function-registry/index.js.map +1 -1
- package/dist/function-registry/judgments.d.ts +5 -0
- package/dist/function-registry/judgments.js +50 -7
- package/dist/function-registry/judgments.js.map +1 -1
- package/dist/function-registry/legacy.d.ts +4 -0
- package/dist/function-registry/legacy.js +50 -7
- package/dist/function-registry/legacy.js.map +1 -1
- package/dist/function-registry/lenses.d.ts +7 -0
- package/dist/function-registry/lenses.js +50 -7
- package/dist/function-registry/lenses.js.map +1 -1
- package/dist/function-registry/nodes.d.ts +412 -0
- package/dist/function-registry/nodes.js +5303 -0
- package/dist/function-registry/nodes.js.map +1 -0
- package/dist/function-registry/ontologies.d.ts +14 -0
- package/dist/function-registry/ontologies.js +50 -7
- package/dist/function-registry/ontologies.js.map +1 -1
- package/dist/function-registry/pipeline.d.ts +6 -0
- package/dist/function-registry/pipeline.js +50 -7
- package/dist/function-registry/pipeline.js.map +1 -1
- package/dist/function-registry/questions.d.ts +15 -0
- package/dist/function-registry/questions.js +50 -7
- package/dist/function-registry/questions.js.map +1 -1
- package/dist/function-registry/tasks.d.ts +7 -0
- package/dist/function-registry/tasks.js +69 -16
- package/dist/function-registry/tasks.js.map +1 -1
- package/dist/function-registry/topics.d.ts +10 -0
- package/dist/function-registry/topics.js +50 -7
- package/dist/function-registry/topics.js.map +1 -1
- package/dist/function-registry/types.d.ts +5 -1
- package/dist/function-registry/worktrees.d.ts +14 -0
- package/dist/function-registry/worktrees.js +50 -7
- package/dist/function-registry/worktrees.js.map +1 -1
- package/dist/gateway.contract.d.ts +3 -0
- package/dist/gateway.contract.js.map +1 -1
- package/dist/generated/convexSchemas.d.ts +3 -3
- package/dist/generated/convexSchemas.js +35 -16
- package/dist/generated/convexSchemas.js.map +1 -1
- package/dist/generated/infisicalRuntimeEnv.d.ts +70 -0
- package/dist/generated/infisicalRuntimeEnv.js +26572 -0
- package/dist/generated/infisicalRuntimeEnv.js.map +1 -0
- package/dist/generated/lucernGatewayEnv.d.ts +17 -0
- package/dist/generated/lucernGatewayEnv.js +38 -0
- package/dist/generated/lucernGatewayEnv.js.map +1 -0
- package/dist/generated/lucernWebPublicEnv.d.ts +26 -0
- package/dist/generated/lucernWebPublicEnv.js +32 -0
- package/dist/generated/lucernWebPublicEnv.js.map +1 -0
- package/dist/generated/lucernWebServerEnv.d.ts +33 -0
- package/dist/generated/lucernWebServerEnv.js +51 -0
- package/dist/generated/lucernWebServerEnv.js.map +1 -0
- package/dist/generated/schema-manifest.json +1165 -150
- package/dist/generated/tableOwnership.d.ts +46 -27
- package/dist/generated/tableOwnership.js +64 -26
- package/dist/generated/tableOwnership.js.map +1 -1
- package/dist/generated/tier-expectations.json +60 -8
- package/dist/{index-O09U2xHk.d.ts → index-CM1Pl_vI.d.ts} +3 -3
- package/dist/index.d.ts +8 -4
- package/dist/index.js +30959 -406
- package/dist/index.js.map +1 -1
- package/dist/infisical-runtime.contract.d.ts +1597 -3
- package/dist/infisical-runtime.contract.js +2788 -12
- package/dist/infisical-runtime.contract.js.map +1 -1
- package/dist/manifests/infisical-runtime-manifest.d.ts +1524 -3
- package/dist/manifests/infisical-runtime-manifest.js +2641 -9
- package/dist/manifests/infisical-runtime-manifest.js.map +1 -1
- package/dist/manifests/tenant-client-manifest.d.ts +11 -11
- package/dist/manifests/tenant-client-manifest.js +11 -11
- package/dist/manifests/tenant-client-manifest.js.map +1 -1
- package/dist/mcp-gateway-boundary.contract.d.ts +23 -3
- package/dist/mcp-gateway-boundary.contract.js +2 -0
- package/dist/mcp-gateway-boundary.contract.js.map +1 -1
- package/dist/projections/check-convex-args-shape.js +10 -6
- package/dist/projections/check-convex-args-shape.js.map +1 -1
- package/dist/projections/create-evidence.projection.d.ts +6 -6
- package/dist/projections/create-evidence.projection.js +2 -3
- package/dist/projections/create-evidence.projection.js.map +1 -1
- package/dist/projections/index.d.ts +3 -3
- package/dist/projections/index.js +10 -6
- package/dist/projections/index.js.map +1 -1
- package/dist/projections/list-tasks.projection.d.ts +20 -8
- package/dist/projections/list-tasks.projection.js +8 -3
- package/dist/projections/list-tasks.projection.js.map +1 -1
- package/dist/proof-attestation.json +45 -0
- package/dist/schemas/component-table-manifest.d.ts +6 -6
- package/dist/schemas/component-table-manifest.js +2 -2
- package/dist/schemas/component-table-manifest.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.js +1086 -137
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/manifest.d.ts +2010 -120
- package/dist/schemas/manifest.js +1084 -135
- package/dist/schemas/manifest.js.map +1 -1
- package/dist/schemas/tables/controlPlane/accessControl.d.ts +260 -0
- package/dist/schemas/tables/controlPlane/accessControl.js +653 -0
- package/dist/schemas/tables/controlPlane/accessControl.js.map +1 -0
- package/dist/schemas/tables/{identity → controlPlane}/agent.d.ts +1 -1
- package/dist/schemas/tables/{identity → controlPlane}/agent.js +3 -3
- package/dist/schemas/tables/controlPlane/agent.js.map +1 -0
- package/dist/schemas/tables/{identity → controlPlane}/epistemic.d.ts +1 -1
- package/dist/schemas/tables/{identity → controlPlane}/epistemic.js +3 -3
- package/dist/schemas/tables/controlPlane/epistemic.js.map +1 -0
- package/dist/schemas/tables/{identity → controlPlane}/model.d.ts +1 -1
- package/dist/schemas/tables/{identity → controlPlane}/model.js +6 -6
- package/dist/schemas/tables/controlPlane/model.js.map +1 -0
- package/dist/schemas/tables/{identity → controlPlane}/platform.d.ts +1 -1
- package/dist/schemas/tables/{identity → controlPlane}/platform.js +18 -18
- package/dist/schemas/tables/controlPlane/platform.js.map +1 -0
- package/dist/schemas/tables/{identity → controlPlane}/project.d.ts +1 -1
- package/dist/schemas/tables/{identity → controlPlane}/project.js +3 -3
- package/dist/schemas/tables/controlPlane/project.js.map +1 -0
- package/dist/schemas/tables/{identity → controlPlane}/user.d.ts +1 -1
- package/dist/schemas/tables/{identity → controlPlane}/user.js +3 -3
- package/dist/schemas/tables/controlPlane/user.js.map +1 -0
- package/dist/schemas/tables/kernel/config.d.ts +1 -1
- package/dist/schemas/tables/kernel/config.js.map +1 -1
- package/dist/schemas/tables/kernel/coordination.d.ts +1 -1
- package/dist/schemas/tables/kernel/coordination.js.map +1 -1
- package/dist/schemas/tables/kernel/decision.d.ts +1 -1
- package/dist/schemas/tables/kernel/decision.js.map +1 -1
- package/dist/schemas/tables/kernel/embedding.d.ts +1 -1
- package/dist/schemas/tables/kernel/embedding.js.map +1 -1
- package/dist/schemas/tables/kernel/epistemic.d.ts +1 -1
- package/dist/schemas/tables/kernel/epistemic.js.map +1 -1
- package/dist/schemas/tables/kernel/idempotency.d.ts +1 -1
- package/dist/schemas/tables/kernel/idempotency.js.map +1 -1
- package/dist/schemas/tables/kernel/infra.d.ts +1 -1
- package/dist/schemas/tables/kernel/infra.js.map +1 -1
- package/dist/schemas/tables/kernel/intelligence.d.ts +1 -1
- package/dist/schemas/tables/kernel/intelligence.js.map +1 -1
- package/dist/schemas/tables/kernel/lens.d.ts +1 -1
- package/dist/schemas/tables/kernel/lens.js.map +1 -1
- package/dist/schemas/tables/kernel/ontology.d.ts +1 -1
- package/dist/schemas/tables/kernel/ontology.js.map +1 -1
- package/dist/schemas/tables/kernel/platform.d.ts +1 -1
- package/dist/schemas/tables/kernel/platform.js.map +1 -1
- package/dist/schemas/tables/kernel/spine.d.ts +2 -1
- package/dist/schemas/tables/kernel/spine.js +1 -0
- package/dist/schemas/tables/kernel/spine.js.map +1 -1
- package/dist/schemas/tables/kernel/task.d.ts +1 -1
- package/dist/schemas/tables/kernel/task.js.map +1 -1
- package/dist/schemas/tables/kernel/topic.d.ts +1 -1
- package/dist/schemas/tables/kernel/topic.js.map +1 -1
- package/dist/schemas/tables/kernel/workflow.d.ts +1 -1
- package/dist/schemas/tables/kernel/workflow.js.map +1 -1
- package/dist/schemas/tables/kernel/worktree.d.ts +5 -5
- package/dist/schemas/tables/kernel/worktree.js.map +1 -1
- package/dist/schemas/tables/mc/identity.d.ts +19 -2
- package/dist/schemas/tables/mc/identity.js +32 -1
- package/dist/schemas/tables/mc/identity.js.map +1 -1
- package/dist/schemas/tables/mc/methodology.d.ts +1 -1
- package/dist/schemas/tables/mc/methodology.js.map +1 -1
- package/dist/schemas/tables/mc/pack.d.ts +1 -1
- package/dist/schemas/tables/mc/pack.js.map +1 -1
- package/dist/schemas/tables/mc/policy.d.ts +2 -2
- package/dist/schemas/tables/mc/policy.js +1 -1
- package/dist/schemas/tables/mc/policy.js.map +1 -1
- package/dist/schemas/tables/mc/registry.d.ts +1 -1
- package/dist/schemas/tables/mc/registry.js.map +1 -1
- package/dist/schemas/tables/mc/runtime.d.ts +109 -3
- package/dist/schemas/tables/mc/runtime.js +330 -104
- package/dist/schemas/tables/mc/runtime.js.map +1 -1
- package/dist/schemas/tables/mc/tenant.d.ts +3 -2
- package/dist/schemas/tables/mc/tenant.js +2 -1
- package/dist/schemas/tables/mc/tenant.js.map +1 -1
- package/dist/schemas/tables/mc/workspace.d.ts +22 -5
- package/dist/schemas/tables/mc/workspace.js +34 -2
- package/dist/schemas/tables/mc/workspace.js.map +1 -1
- package/dist/sdk-tools.contract.js +26 -1
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/tenant-bootstrap-seed.contract.d.ts +226 -58
- package/dist/tenant-bootstrap-seed.contract.js +126 -28
- package/dist/tenant-bootstrap-seed.contract.js.map +1 -1
- package/dist/tenant-bootstrap-seed.defaults.d.ts +1 -1
- package/dist/tenant-bootstrap-seed.defaults.js +1 -1
- package/dist/tenant-bootstrap-seed.defaults.js.map +1 -1
- package/dist/tenant-client.contract.d.ts +12 -12
- package/dist/tenant-client.contract.js +11 -11
- package/dist/tenant-client.contract.js.map +1 -1
- package/dist/tool-contracts.js +26 -1
- package/dist/tool-contracts.js.map +1 -1
- package/package.json +22 -1
- package/dist/schemas/tables/identity/agent.js.map +0 -1
- package/dist/schemas/tables/identity/epistemic.js.map +0 -1
- package/dist/schemas/tables/identity/model.js.map +0 -1
- package/dist/schemas/tables/identity/platform.js.map +0 -1
- package/dist/schemas/tables/identity/project.js.map +0 -1
- package/dist/schemas/tables/identity/user.js.map +0 -1
|
@@ -83,6 +83,9 @@ type FunctionConvexTarget = {
|
|
|
83
83
|
inputProjection?: ContractInputProjection;
|
|
84
84
|
outputProjection?: ContractOutputProjection;
|
|
85
85
|
};
|
|
86
|
+
type FunctionGatewayTarget = {
|
|
87
|
+
handler: "tasks.create" | "tasks.list" | "tasks.update" | "tasks.complete";
|
|
88
|
+
};
|
|
86
89
|
|
|
87
90
|
declare const codingContracts: readonly [{
|
|
88
91
|
name: string;
|
|
@@ -115,6 +118,7 @@ declare const codingContracts: readonly [{
|
|
|
115
118
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
116
119
|
};
|
|
117
120
|
convex: FunctionConvexTarget | undefined;
|
|
121
|
+
gateway: FunctionGatewayTarget | undefined;
|
|
118
122
|
args: z.ZodTypeAny;
|
|
119
123
|
returns: z.ZodTypeAny;
|
|
120
124
|
input: z.ZodTypeAny;
|
|
@@ -154,6 +158,7 @@ declare const codingContracts: readonly [{
|
|
|
154
158
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
155
159
|
};
|
|
156
160
|
convex: FunctionConvexTarget | undefined;
|
|
161
|
+
gateway: FunctionGatewayTarget | undefined;
|
|
157
162
|
args: z.ZodTypeAny;
|
|
158
163
|
returns: z.ZodTypeAny;
|
|
159
164
|
input: z.ZodTypeAny;
|
|
@@ -193,6 +198,7 @@ declare const codingContracts: readonly [{
|
|
|
193
198
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
194
199
|
};
|
|
195
200
|
convex: FunctionConvexTarget | undefined;
|
|
201
|
+
gateway: FunctionGatewayTarget | undefined;
|
|
196
202
|
args: z.ZodTypeAny;
|
|
197
203
|
returns: z.ZodTypeAny;
|
|
198
204
|
input: z.ZodTypeAny;
|
|
@@ -232,6 +238,7 @@ declare const codingContracts: readonly [{
|
|
|
232
238
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
233
239
|
};
|
|
234
240
|
convex: FunctionConvexTarget | undefined;
|
|
241
|
+
gateway: FunctionGatewayTarget | undefined;
|
|
235
242
|
args: z.ZodTypeAny;
|
|
236
243
|
returns: z.ZodTypeAny;
|
|
237
244
|
input: z.ZodTypeAny;
|
|
@@ -271,6 +278,7 @@ declare const codingContracts: readonly [{
|
|
|
271
278
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
272
279
|
};
|
|
273
280
|
convex: FunctionConvexTarget | undefined;
|
|
281
|
+
gateway: FunctionGatewayTarget | undefined;
|
|
274
282
|
args: z.ZodTypeAny;
|
|
275
283
|
returns: z.ZodTypeAny;
|
|
276
284
|
input: z.ZodTypeAny;
|
|
@@ -310,6 +318,7 @@ declare const codingContracts: readonly [{
|
|
|
310
318
|
allowedPrincipalTypes: ("user" | "service" | "agent")[];
|
|
311
319
|
};
|
|
312
320
|
convex: FunctionConvexTarget | undefined;
|
|
321
|
+
gateway: FunctionGatewayTarget | undefined;
|
|
313
322
|
args: z.ZodTypeAny;
|
|
314
323
|
returns: z.ZodTypeAny;
|
|
315
324
|
input: z.ZodTypeAny;
|
|
@@ -2,6 +2,20 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
// src/function-registry/coding.ts
|
|
4
4
|
|
|
5
|
+
// src/types/reasoning-method.ts
|
|
6
|
+
var REASONING_METHODS = [
|
|
7
|
+
"deductive",
|
|
8
|
+
"inductive",
|
|
9
|
+
"abductive",
|
|
10
|
+
"analogical",
|
|
11
|
+
"causal",
|
|
12
|
+
"correlational",
|
|
13
|
+
"testimonial",
|
|
14
|
+
"statistical",
|
|
15
|
+
"implicit",
|
|
16
|
+
"pattern_match"
|
|
17
|
+
];
|
|
18
|
+
|
|
5
19
|
// src/lens-workflow.contract.ts
|
|
6
20
|
var LENS_PERSPECTIVE_TYPES = [
|
|
7
21
|
"investigation",
|
|
@@ -859,7 +873,7 @@ var CREATE_EDGE = {
|
|
|
859
873
|
reasoningMethod: {
|
|
860
874
|
type: "string",
|
|
861
875
|
description: "How this was determined",
|
|
862
|
-
enum: [
|
|
876
|
+
enum: [...REASONING_METHODS]
|
|
863
877
|
},
|
|
864
878
|
metadata: {
|
|
865
879
|
type: "object",
|
|
@@ -2586,6 +2600,10 @@ var CREATE_TASK = {
|
|
|
2586
2600
|
tags: {
|
|
2587
2601
|
type: "array",
|
|
2588
2602
|
description: "Free-form string tags"
|
|
2603
|
+
},
|
|
2604
|
+
metadata: {
|
|
2605
|
+
type: "object",
|
|
2606
|
+
description: "Structured task metadata for handoff context and routing hints"
|
|
2589
2607
|
}
|
|
2590
2608
|
},
|
|
2591
2609
|
required: ["title"],
|
|
@@ -2659,6 +2677,10 @@ var UPDATE_TASK = {
|
|
|
2659
2677
|
type: "string",
|
|
2660
2678
|
description: "Updated status",
|
|
2661
2679
|
enum: ["todo", "in_progress", "blocked", "done"]
|
|
2680
|
+
},
|
|
2681
|
+
metadata: {
|
|
2682
|
+
type: "object",
|
|
2683
|
+
description: "Structured task metadata to replace or refine"
|
|
2662
2684
|
}
|
|
2663
2685
|
},
|
|
2664
2686
|
required: ["taskId"],
|
|
@@ -4114,6 +4136,9 @@ var BEGIN_BUILD_SESSION = {
|
|
|
4114
4136
|
sessionMode: "string \u2014 async | interactive",
|
|
4115
4137
|
targetBeliefIds: "array \u2014 scoped belief IDs",
|
|
4116
4138
|
targetQuestionIds: "array \u2014 scoped question IDs",
|
|
4139
|
+
taskIds: "array \u2014 assigned task IDs for this worktree",
|
|
4140
|
+
incompleteTaskIds: "array \u2014 assigned task IDs that still require done/deferred/blocked proof",
|
|
4141
|
+
tasks: "array \u2014 assigned task packet with id, title, status, priority, links, and summaries",
|
|
4117
4142
|
topBeliefs: "array \u2014 highest-confidence scoped beliefs",
|
|
4118
4143
|
openQuestions: "array \u2014 open scoped questions",
|
|
4119
4144
|
resolvedDecisions: "array \u2014 answered questions summarized for the session",
|
|
@@ -4618,6 +4643,13 @@ var LUCERN_OPERATION_MANIFEST = {
|
|
|
4618
4643
|
"Lucern MCP-only platform operation for local agent/bootstrap or verification workflows. Hidden from public discovery."
|
|
4619
4644
|
)
|
|
4620
4645
|
};
|
|
4646
|
+
z.enum(["decision", "belief", "question", "theme", "deal", "topic", "claim", "evidence", "synthesis", "answer", "atomic_fact", "excerpt", "source", "company", "person", "investor", "function", "value_chain"]);
|
|
4647
|
+
var EDGE_TYPE_VALUES = ["supports", "informs", "depends_on", "derived_from", "contains", "tests", "supersedes", "responds_to", "belongs_to", "relates_to_thesis", "works_at", "invested_in", "competes_with", "participates_in", "founded_by", "evaluates", "performs", "function_in", "impacts", "raised_from", "mentioned_in", "perspective_on", "plays_theme", "answers", "explores", "qualifies", "based_on", "based_on_belief", "based_on_question", "blocked_by_contradiction", "informed_by_theme", "same_as", "reinforces", "parent_of", "child_of", "falsified_by", "exclusive_with", "collapses_if", "cascade_from", "counterfactual_of", "cascade_to", "mutually_exclusive", "correlates_with", "amplifies", "precondition_for", "in_tension_with", "strengthened_by", "weakened_by", "alternative_to", "subsumes", "validated_by", "required_for", "blocks", "prerequisite_for", "parallel_to", "corroborates", "extends", "same_source_as", "same_theme_as", "assumes", "would_predict", "analogous_to", "independent_of", "implements", "violates", "co_changes_with", "migrating_from", "migrating_to", "scoped_by", "about_entity", "entity_referenced_in", "contradicts", "cites", "summarizes", "related_to", "partially_answers", "refines", "branches_from"];
|
|
4648
|
+
var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
|
|
4649
|
+
z.enum(EDGE_TYPE_VALUES);
|
|
4650
|
+
z.enum(STORAGE_EDGE_TYPE_VALUES);
|
|
4651
|
+
z.enum(["active", "archived", "watching"]);
|
|
4652
|
+
z.enum(["private", "team", "firm", "external", "public"]);
|
|
4621
4653
|
|
|
4622
4654
|
// src/function-registry/helpers.ts
|
|
4623
4655
|
var jsonObjectSchema = z.record(z.unknown());
|
|
@@ -4714,12 +4746,20 @@ function unwrapMcpParameterSchema(schema) {
|
|
|
4714
4746
|
current = current._def.schema;
|
|
4715
4747
|
continue;
|
|
4716
4748
|
default:
|
|
4717
|
-
return {
|
|
4749
|
+
return {
|
|
4750
|
+
schema: current,
|
|
4751
|
+
required,
|
|
4752
|
+
description: description ?? current.description
|
|
4753
|
+
};
|
|
4718
4754
|
}
|
|
4719
4755
|
}
|
|
4720
4756
|
}
|
|
4721
4757
|
function mcpParameterFromZod(fieldName, schema, contractName) {
|
|
4722
|
-
const {
|
|
4758
|
+
const {
|
|
4759
|
+
schema: unwrapped,
|
|
4760
|
+
required,
|
|
4761
|
+
description: schemaDescription
|
|
4762
|
+
} = unwrapMcpParameterSchema(schema);
|
|
4723
4763
|
const description = schemaDescription ?? unwrapped.description ?? fieldName;
|
|
4724
4764
|
switch (unwrapped._def.typeName) {
|
|
4725
4765
|
case z.ZodFirstPartyTypeKind.ZodString:
|
|
@@ -4764,10 +4804,12 @@ function mcpContractFromArgsSchema(base, args, contractName) {
|
|
|
4764
4804
|
const entries2 = Object.entries(getObjectShape(args)).sort(
|
|
4765
4805
|
([left], [right]) => left.localeCompare(right)
|
|
4766
4806
|
);
|
|
4767
|
-
const converted = entries2.map(
|
|
4768
|
-
fieldName,
|
|
4769
|
-
|
|
4770
|
-
|
|
4807
|
+
const converted = entries2.map(
|
|
4808
|
+
([fieldName, schema]) => [
|
|
4809
|
+
fieldName,
|
|
4810
|
+
mcpParameterFromZod(fieldName, schema, contractName)
|
|
4811
|
+
]
|
|
4812
|
+
);
|
|
4771
4813
|
return {
|
|
4772
4814
|
...base,
|
|
4773
4815
|
parameters: Object.fromEntries(
|
|
@@ -4873,6 +4915,7 @@ function surfaceContract(args) {
|
|
|
4873
4915
|
allowedPrincipalTypes: ["user", "service", "agent"]
|
|
4874
4916
|
},
|
|
4875
4917
|
convex: args.convex,
|
|
4918
|
+
gateway: args.gateway,
|
|
4876
4919
|
args: canonicalArgs,
|
|
4877
4920
|
returns: canonicalReturns,
|
|
4878
4921
|
input,
|
|
@@ -4885,6 +4928,69 @@ function surfaceContract(args) {
|
|
|
4885
4928
|
}
|
|
4886
4929
|
|
|
4887
4930
|
// src/function-registry/coding.ts
|
|
4931
|
+
function isRecord(value) {
|
|
4932
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
4933
|
+
}
|
|
4934
|
+
function stringValues(value) {
|
|
4935
|
+
if (typeof value === "string") {
|
|
4936
|
+
return [value];
|
|
4937
|
+
}
|
|
4938
|
+
if (Array.isArray(value)) {
|
|
4939
|
+
return value.flatMap((item) => stringValues(item));
|
|
4940
|
+
}
|
|
4941
|
+
return [];
|
|
4942
|
+
}
|
|
4943
|
+
function nestedEvidenceRows(value) {
|
|
4944
|
+
if (Array.isArray(value)) {
|
|
4945
|
+
return value.flatMap((item) => nestedEvidenceRows(item));
|
|
4946
|
+
}
|
|
4947
|
+
if (!isRecord(value)) {
|
|
4948
|
+
return [];
|
|
4949
|
+
}
|
|
4950
|
+
const nestedKeys = ["evidence", "items", "nodes"];
|
|
4951
|
+
const nestedRows = nestedKeys.flatMap((key) => nestedEvidenceRows(value[key]));
|
|
4952
|
+
return nestedRows.length > 0 ? nestedRows : [value];
|
|
4953
|
+
}
|
|
4954
|
+
function isFailedAttemptRow(row) {
|
|
4955
|
+
const metadata = isRecord(row.metadata) ? row.metadata : null;
|
|
4956
|
+
return metadata?.failedApproach === true || metadata?.isFailedAttempt === true;
|
|
4957
|
+
}
|
|
4958
|
+
function failureLogSearchFields(row) {
|
|
4959
|
+
const metadata = isRecord(row.metadata) ? row.metadata : null;
|
|
4960
|
+
return [
|
|
4961
|
+
...stringValues(row.id),
|
|
4962
|
+
...stringValues(row._id),
|
|
4963
|
+
...stringValues(row.title),
|
|
4964
|
+
...stringValues(row.text),
|
|
4965
|
+
...stringValues(row.canonicalText),
|
|
4966
|
+
...stringValues(row.content),
|
|
4967
|
+
...stringValues(metadata?.codeAnchor),
|
|
4968
|
+
...stringValues(metadata?.codeAnchors),
|
|
4969
|
+
...stringValues(metadata?.anchor),
|
|
4970
|
+
...stringValues(metadata?.anchors),
|
|
4971
|
+
...stringValues(metadata?.filePath),
|
|
4972
|
+
...stringValues(metadata?.filePaths),
|
|
4973
|
+
...stringValues(metadata?.path),
|
|
4974
|
+
...stringValues(metadata?.paths),
|
|
4975
|
+
...stringValues(metadata?.sourceRef),
|
|
4976
|
+
...stringValues(metadata?.touchedPaths)
|
|
4977
|
+
];
|
|
4978
|
+
}
|
|
4979
|
+
function projectFailureLog(output, input) {
|
|
4980
|
+
const rawQuery = typeof input.query === "string" && input.query.trim().length > 0 ? input.query.trim() : void 0;
|
|
4981
|
+
const searchKey = rawQuery?.toLowerCase();
|
|
4982
|
+
const failures = nestedEvidenceRows(output).filter((row) => isFailedAttemptRow(row)).filter(
|
|
4983
|
+
(row) => !searchKey ? true : failureLogSearchFields(row).some(
|
|
4984
|
+
(field) => field.toLowerCase().includes(searchKey)
|
|
4985
|
+
)
|
|
4986
|
+
);
|
|
4987
|
+
return {
|
|
4988
|
+
query: rawQuery,
|
|
4989
|
+
failures,
|
|
4990
|
+
totalFound: failures.length,
|
|
4991
|
+
showing: failures.length
|
|
4992
|
+
};
|
|
4993
|
+
}
|
|
4888
4994
|
var recordScopeLearningArgs = z.object({
|
|
4889
4995
|
topicId: z.string().optional().describe("Topic scope ID"),
|
|
4890
4996
|
summary: z.string().describe("Atomic learning statement"),
|
|
@@ -4974,6 +5080,8 @@ var attemptInput = (input, context) => withUserId(
|
|
|
4974
5080
|
tags: ["code_attempt"],
|
|
4975
5081
|
metadata: compactRecord({
|
|
4976
5082
|
...recordValue(input.metadata),
|
|
5083
|
+
failedApproach: true,
|
|
5084
|
+
isFailedAttempt: true,
|
|
4977
5085
|
filePaths: input.filePaths,
|
|
4978
5086
|
filePath: input.filePath,
|
|
4979
5087
|
errorMessage: input.errorMessage,
|
|
@@ -5104,7 +5212,8 @@ var codingContracts = [
|
|
|
5104
5212
|
limit: input.limit,
|
|
5105
5213
|
status: input.status,
|
|
5106
5214
|
userId: input.userId
|
|
5107
|
-
})
|
|
5215
|
+
}),
|
|
5216
|
+
outputProjection: (output, input) => projectFailureLog(output, input)
|
|
5108
5217
|
}
|
|
5109
5218
|
})
|
|
5110
5219
|
];
|