@lucern/sdk 0.2.0-alpha.9 → 0.3.0-alpha.0

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 (101) hide show
  1. package/README.md +6 -0
  2. package/dist/adminClient.d.ts +15 -9
  3. package/dist/adminClient.js.map +1 -1
  4. package/dist/audience/index.d.ts +38 -0
  5. package/dist/audience/index.js +110 -0
  6. package/dist/audience/index.js.map +1 -0
  7. package/dist/beliefs/index.d.ts +463 -0
  8. package/dist/beliefs/index.js +6694 -0
  9. package/dist/beliefs/index.js.map +1 -0
  10. package/dist/beliefs/lifecycle.d.ts +24 -0
  11. package/dist/beliefs/lifecycle.js +98 -0
  12. package/dist/beliefs/lifecycle.js.map +1 -0
  13. package/dist/beliefsClient.d.ts +91 -12
  14. package/dist/beliefsClient.js +176 -7
  15. package/dist/beliefsClient.js.map +1 -1
  16. package/dist/client-DAuKnDlx.d.ts +2547 -0
  17. package/dist/client.d.ts +31 -2377
  18. package/dist/client.js +783 -245
  19. package/dist/client.js.map +1 -1
  20. package/dist/contracts/api-enums.contract.d.ts +1 -1
  21. package/dist/contracts/api-enums.contract.js +8 -2
  22. package/dist/contracts/api-enums.contract.js.map +1 -1
  23. package/dist/contracts/index.d.ts +4 -2
  24. package/dist/contracts/index.js +118 -4282
  25. package/dist/contracts/index.js.map +1 -1
  26. package/dist/contracts/mcpTools.d.ts +2 -1
  27. package/dist/contracts/mcpTools.js +22 -2981
  28. package/dist/contracts/mcpTools.js.map +1 -1
  29. package/dist/contracts/sdk-tools.contract.d.ts +1 -2
  30. package/dist/contracts/sdk-tools.contract.js +1 -4132
  31. package/dist/contracts/sdk-tools.contract.js.map +1 -1
  32. package/dist/contracts/sdkTools.d.ts +1 -2
  33. package/dist/contracts/sdkTools.js +20 -4127
  34. package/dist/contracts/sdkTools.js.map +1 -1
  35. package/dist/contracts/tool-contracts.d.ts +1 -0
  36. package/dist/contracts/tool-contracts.js +3 -0
  37. package/dist/contracts/tool-contracts.js.map +1 -0
  38. package/dist/contradictions/index.d.ts +156 -0
  39. package/dist/contradictions/index.js +6688 -0
  40. package/dist/contradictions/index.js.map +1 -0
  41. package/dist/customTools.d.ts +1 -1
  42. package/dist/decisions/index.d.ts +66 -0
  43. package/dist/decisions/index.js +6690 -0
  44. package/dist/decisions/index.js.map +1 -0
  45. package/dist/edges/index.d.ts +202 -0
  46. package/dist/edges/index.js +6689 -0
  47. package/dist/edges/index.js.map +1 -0
  48. package/dist/events.js +7 -5
  49. package/dist/events.js.map +1 -1
  50. package/dist/evidence/index.d.ts +293 -0
  51. package/dist/evidence/index.js +6689 -0
  52. package/dist/evidence/index.js.map +1 -0
  53. package/dist/evidenceClient.d.ts +119 -0
  54. package/dist/evidenceClient.js +350 -0
  55. package/dist/evidenceClient.js.map +1 -0
  56. package/dist/gatewayFacades.d.ts +8 -10
  57. package/dist/gatewayFacades.js +54 -1
  58. package/dist/gatewayFacades.js.map +1 -1
  59. package/dist/identityClient.d.ts +3 -3
  60. package/dist/identityClient.js.map +1 -1
  61. package/dist/index.d.ts +7 -6
  62. package/dist/index.js +1092 -3294
  63. package/dist/index.js.map +1 -1
  64. package/dist/lenses/index.d.ts +192 -0
  65. package/dist/lenses/index.js +6688 -0
  66. package/dist/lenses/index.js.map +1 -0
  67. package/dist/nodes/index.d.ts +61 -0
  68. package/dist/nodes/index.js +6690 -0
  69. package/dist/nodes/index.js.map +1 -0
  70. package/dist/ontologies/index.d.ts +179 -0
  71. package/dist/ontologies/index.js +6691 -0
  72. package/dist/ontologies/index.js.map +1 -0
  73. package/dist/opinion.d.ts +11 -0
  74. package/dist/opinion.js +35 -0
  75. package/dist/opinion.js.map +1 -0
  76. package/dist/questions/index.d.ts +295 -0
  77. package/dist/questions/index.js +6691 -0
  78. package/dist/questions/index.js.map +1 -0
  79. package/dist/sdk-tools.contract-B4c1Zr1o.d.ts +22 -0
  80. package/dist/sourcesClient.d.ts +24 -0
  81. package/dist/{mcpParityClient.js → sourcesClient.js} +15 -192
  82. package/dist/sourcesClient.js.map +1 -0
  83. package/dist/tool-contracts-BUiL9P6z.d.ts +22 -0
  84. package/dist/topics/index.d.ts +66 -0
  85. package/dist/topics/index.js +6689 -0
  86. package/dist/topics/index.js.map +1 -0
  87. package/dist/types.d.ts +20 -1
  88. package/dist/worktrees/index.d.ts +208 -0
  89. package/dist/worktrees/index.js +6691 -0
  90. package/dist/worktrees/index.js.map +1 -0
  91. package/package.json +55 -3
  92. package/dist/contracts/mcp-tools.contract.d.ts +0 -1
  93. package/dist/contracts/mcp-tools.contract.js +0 -2986
  94. package/dist/contracts/mcp-tools.contract.js.map +0 -1
  95. package/dist/mcpParityClient.d.ts +0 -74
  96. package/dist/mcpParityClient.js.map +0 -1
  97. package/dist/mcpParitySurface.d.ts +0 -12
  98. package/dist/mcpParitySurface.js +0 -65
  99. package/dist/mcpParitySurface.js.map +0 -1
  100. package/dist/mcpTools-DPZxowDX.d.ts +0 -254
  101. package/dist/sdkTools-CwXJDACb.d.ts +0 -150
@@ -0,0 +1,2547 @@
1
+ import { AudiencesClientConfig, AudienceRegistryInput, AudienceGrantInput, AudienceGrantRevokeInput } from './audiencesClient.js';
2
+ import { SchemaClientConfig, SchemaPackInstallInput, SchemaEntitlementInput } from './schemaClient.js';
3
+ import { HarnessClientConfig, HarnessAgentWriteInput, HarnessInvokeManagedAgentInput, HarnessToolWriteInput, HarnessExecuteToolInput, HarnessExecuteToolResult, HarnessStartRunInput, HarnessRunReportInput, HarnessCompleteRunInput } from './harnessClient.js';
4
+ import { IdentityClientConfig, ClerkUserSearchResult } from './identityClient.js';
5
+ import { AdminClientConfig, TenantApiKeyRecord, TenantVaultSecretRecord, TenantConfigRecord, TenantModelRoutingSnapshot } from './adminClient.js';
6
+ import { ControlObjectOwnershipContract } from './controlObjectOwnership.js';
7
+ import { BeliefsClientConfig, ModulateConfidenceInput, OpinionHistoryEntry, CreateBeliefInput, RefineBeliefInput, ModulateConfidenceOpinionInput, ModulateConfidenceScalarInput, ForkBeliefInput, UpdateBeliefStatusInput, UpdateBeliefRationaleInput, LinkBeliefsInput, UnlinkBeliefEvidenceInput, UpdateBeliefCriticalityInput, BatchUpdateBeliefCriticalityInput, ReassignBeliefsTopicInput } from './beliefsClient.js';
8
+ import { PacksClientConfig, PackInstallInput, PackEnableInput, PackDisableInput, PackEntitlementInput, PackUninstallInput, PackUpgradeInput } from './packsClient.js';
9
+ import { CustomToolRegistration, RegisteredCustomTool } from './customTools.js';
10
+ import { PolicyClientConfig, PermissionDecision, PermissionKind, WritePolicyRecord, WritePolicyCreateInput, WritePolicyUpdateInput, TenantPolicyRecord, TenantPolicyPermission } from './policyClient.js';
11
+ import { GatewayClientConfig, PlatformGatewaySuccess, GatewayScope } from './coreClient.js';
12
+ import { OntologyClientConfig, OntologyBindingInput, OntologyDefinitionInput, OntologyDefinitionUpdateInput, OntologyVersionInput } from './ontologyClient.js';
13
+ import { CompileContextInput, PublicCompiledContext } from './contextTypes.js';
14
+ import { TopicsClientConfig, TopicListInput, TopicCreateInput, TopicUpdateInput, TopicTreeQuery, TopicCoverageQuery, TopicBulkCreateInput } from './topicsClient.js';
15
+ import { AnswersClientConfig } from './answersClient.js';
16
+ import { AuditClientConfig } from './auditClient.js';
17
+ import { ContextClientConfig } from './contextClient.js';
18
+ import { LensPromptTemplateReference, LensWorkflowTemplate, LensTaskTemplate } from './contracts/lens-workflow.contract.js';
19
+ import { DecisionsClientConfig, RecordJudgmentInput, ListJudgmentsInput, RecordJudgmentOutcomeInput, GetJudgmentCalibrationInput, ListPendingJudgmentOutcomeReviewInput, GetJudgmentTransitionAuditIntegrityInput } from './decisionsClient.js';
20
+ import { EvidenceClientConfig, EvidenceClassificationRequestConfig, ClassifyEvidenceResult, ClassifyEvidenceBatchItem, ClassifyEvidenceBatchResult } from './evidenceClient.js';
21
+ import { GraphClientConfig, ListNodesInput, GetNodeInput, CreateNodeInput, UpdateNodeInput, BatchCreateNodesInput, SupersedeNodeInput, VerifyNodeInput, HardDeleteNodeInput, CreateEdgeInput, NeighborhoodInput, QueryNodesInput, ListEdgesInput, QueryEdgesInput, DeleteEdgeInput, TraverseInput, AnalyzeInput, BiasInput, GapsInput, SearchInput, PathInput, AnalyticsInput } from './graphClient.js';
22
+ import { LearningClientConfig } from './learningClient.js';
23
+ import { JsonObject, PlatformSourceRecord, ListResult, PlatformGraphNode, PlatformGraphEdge, GraphNeighborhoodResponse, JsonArray, RecordJudgmentResponse, ListJudgmentsResponse, GetJudgmentResponse, RecordJudgmentOutcomeResponse, JudgmentReadinessResponse, JudgmentCalibrationResponse, PendingJudgmentOutcomeRecord, JudgmentTransitionAuditIntegrityResponse, TopicIdentifierInput, WorkflowBranchRecord, WorkflowLensRecord, WorkflowLensBindingRecord, WorkflowWorktreeRecord, ListWorktreesResponse, PushWorktreeResponse, OpenPullRequestResponse, TopicListResponse, TopicRecord, TopicTreeResponse, TopicCoverageResponse, PlatformBeliefRecord, ModulateConfidenceResponse, ForkBeliefResponse, DeleteEdgeResponse, GraphPathResponse, GraphAnalyticsResponse, MergeWorktreeResponse, ListTopicsResponse, SwitchTopicContextResponse, CreateTaskResponse, CompleteTaskResponse, UpdateTaskResponse, ReportTemplatesResponse, ReportWithSectionsResponse } from './types.js';
24
+ import { ReportsClientConfig } from './reportsClient.js';
25
+ import { SourcesClientConfig, UpsertSourceSpec } from './sourcesClient.js';
26
+ import { WorkflowClientConfig, WorkflowLensPerspectiveType, WorkflowLensStatus, AddWorktreeInput, WorkflowWorktreeStatus, UpdateWorktreeTargetsInput, MergeInput, CreateTaskInput, CompleteTaskInput, UpdateTaskInput, WorkflowBranchStatus, CompleteWorktreeInput, AdvanceWorktreePhaseInput, SetWorktreePhaseInput, PatchWorktreeStateInput, BulkCreateWorktreesInput, ListTopicsInput, SwitchTopicContextInput } from './workflowClient.js';
27
+
28
+ type FunctionSurfaceClientConfig = GatewayClientConfig;
29
+ type FunctionSurfaceInput = JsonObject;
30
+ type FunctionSurfaceResult<T = unknown> = Promise<PlatformGatewaySuccess<T>>;
31
+ declare const FUNCTION_SURFACE_METHOD_PATHS: readonly ["answers.answerQuestion", "answers.createAnswer", "answers.getAnswer", "beliefs.archiveBelief", "beliefs.bisectConfidence", "beliefs.createBelief", "beliefs.forkBelief", "beliefs.getBelief", "beliefs.getConfidenceHistory", "beliefs.listBeliefs", "beliefs.modulateConfidence", "beliefs.refineBelief", "beliefs.searchBeliefs", "bootstrap.generateSessionHandoff", "coding.getChangeHistory", "coding.getCodeContext", "coding.getFailureLog", "coding.recordAttempt", "context.analyzeTopicDensity", "context.applyAutoBranching", "context.compileContext", "context.discover", "context.discoverEntityConnections", "context.getLatticeCoverage", "context.recordScopeLearning", "context.seedBeliefLattice", "context.triggerBeliefReview", "contracts.createEpistemicContract", "contracts.evaluateContract", "contracts.getContractStatus", "contradictions.flagContradiction", "coordination.broadcastMessage", "coordination.claimFiles", "coordination.endSession", "coordination.getAgentInbox", "coordination.heartbeatSession", "coordination.listActiveSessions", "coordination.registerSession", "coordination.sendAgentMessage", "edges.createEdge", "edges.queryLineage", "evidence.addEvidence", "evidence.createEvidence", "evidence.getEvidence", "evidence.linkEvidence", "evidence.linkEvidenceToBelief", "evidence.linkEvidenceToQuestion", "evidence.listEvidence", "evidence.searchEvidence", "graph.detectConfirmationBias", "graph.findContradictions", "graph.getGraphGaps", "graph.getGraphNeighborhood", "graph.getGraphStructureAnalysis", "graph.getTopicCoverage", "graph.traceEntityImpact", "graph.traverseGraph", "identity.checkPermission", "identity.filterByPermission", "identity.whoami", "judgments.getAuditTrail", "judgments.recordJudgment", "lenses.applyLensToTopic", "lenses.createLens", "lenses.listLenses", "lenses.removeLensFromTopic", "observations.getObservationContext", "observations.ingestObservation", "ontologies.applyOntology", "ontologies.archiveOntology", "ontologies.createOntology", "ontologies.createOntologyVersion", "ontologies.deprecateOntologyVersion", "ontologies.getOntology", "ontologies.listOntologies", "ontologies.matchEntityType", "ontologies.publishOntologyVersion", "ontologies.resolveEffectiveOntology", "ontologies.updateOntology", "policy.manageWritePolicy", "questions.archiveQuestion", "questions.createQuestion", "questions.findMissingQuestions", "questions.getFalsificationQuestions", "questions.getHighPriorityQuestions", "questions.getQuestion", "questions.listQuestions", "questions.refineQuestion", "questions.updateQuestionStatus", "tasks.completeTask", "tasks.createTask", "tasks.listTasks", "tasks.updateTask", "topics.createTopic", "topics.getTopic", "topics.getTopicTree", "topics.listTopics", "topics.updateTopic", "worktrees.activateWorktree", "worktrees.addWorktree", "worktrees.listAllWorktrees", "worktrees.listWorktrees", "worktrees.merge", "worktrees.openPullRequest", "worktrees.pipelineSnapshot", "worktrees.push", "worktrees.updateWorktreeMetadata", "worktrees.updateWorktreeTargets"];
32
+ declare function createFunctionSurfaceClient(config?: FunctionSurfaceClientConfig): {
33
+ sessionId: string;
34
+ activateWorktree(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
35
+ addEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
36
+ addWorktree(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
37
+ analyzeTopicDensity(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
38
+ answerQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
39
+ applyAutoBranching(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
40
+ applyLensToTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
41
+ applyOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
42
+ archiveBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
43
+ archiveOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
44
+ archiveQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
45
+ bisectConfidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
46
+ broadcastMessage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
47
+ checkPermission(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
48
+ claimFiles(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
49
+ compileContext(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
50
+ completeTask(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
51
+ createAnswer(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
52
+ createBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
53
+ createEdge(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
54
+ createEpistemicContract(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
55
+ createEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
56
+ createLens(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
57
+ createOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
58
+ createOntologyVersion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
59
+ createQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
60
+ createTask(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
61
+ createTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
62
+ deprecateOntologyVersion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
63
+ detectConfirmationBias(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
64
+ discover(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
65
+ discoverEntityConnections(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
66
+ endSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
67
+ evaluateContract(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
68
+ filterByPermission(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
69
+ findContradictions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
70
+ findMissingQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
71
+ flagContradiction(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
72
+ forkBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
73
+ generateSessionHandoff(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
74
+ getAgentInbox(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
75
+ getAnswer(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
76
+ getAuditTrail(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
77
+ getBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
78
+ getChangeHistory(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
79
+ getCodeContext(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
80
+ getConfidenceHistory(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
81
+ getContractStatus(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
82
+ getEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
83
+ getFailureLog(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
84
+ getFalsificationQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
85
+ getGraphGaps(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
86
+ getGraphNeighborhood(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
87
+ getGraphStructureAnalysis(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
88
+ getHighPriorityQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
89
+ getLatticeCoverage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
90
+ getObservationContext(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
91
+ getOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
92
+ getQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
93
+ getTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
94
+ getTopicCoverage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
95
+ getTopicTree(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
96
+ heartbeatSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
97
+ whoami(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
98
+ ingestObservation(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
99
+ linkEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
100
+ linkEvidenceToBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
101
+ linkEvidenceToQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
102
+ listActiveSessions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
103
+ listAllWorktrees(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
104
+ listBeliefs(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
105
+ listEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
106
+ listLenses(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
107
+ listOntologies(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
108
+ listQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
109
+ listTasks(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
110
+ listTopics(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
111
+ listWorktrees(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
112
+ manageWritePolicy(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
113
+ matchEntityType(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
114
+ merge(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
115
+ modulateConfidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
116
+ openPullRequest(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
117
+ pipelineSnapshot(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
118
+ publishOntologyVersion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
119
+ push(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
120
+ queryLineage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
121
+ recordAttempt(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
122
+ recordJudgment(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
123
+ recordScopeLearning(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
124
+ refineBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
125
+ refineQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
126
+ registerSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
127
+ removeLensFromTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
128
+ resolveEffectiveOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
129
+ searchBeliefs(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
130
+ searchEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
131
+ seedBeliefLattice(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
132
+ sendAgentMessage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
133
+ traceEntityImpact(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
134
+ traverseGraph(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
135
+ triggerBeliefReview(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
136
+ updateOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
137
+ updateQuestionStatus(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
138
+ updateTask(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
139
+ updateTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
140
+ updateWorktreeMetadata(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
141
+ updateWorktreeTargets(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
142
+ };
143
+
144
+ type ClientConfig = BeliefsClientConfig | SourcesClientConfig | GraphClientConfig | DecisionsClientConfig | AnswersClientConfig | ContextClientConfig | WorkflowClientConfig | AuditClientConfig | AdminClientConfig | EvidenceClientConfig | IdentityClientConfig | PolicyClientConfig | PacksClientConfig | ReportsClientConfig | LearningClientConfig | FunctionSurfaceClientConfig | OntologyClientConfig | HarnessClientConfig | SchemaClientConfig | AudiencesClientConfig | TopicsClientConfig;
145
+ type CustomToolInput = JsonObject;
146
+ type CustomToolInvoker = (input?: CustomToolInput) => Promise<unknown>;
147
+ type CustomToolNamespace = Record<string, CustomToolInvoker>;
148
+ type GatewayDataEnvelope<T extends Record<string, unknown>> = PlatformGatewaySuccess<T> & T;
149
+ type BeliefsCompatCreateInput = {
150
+ topicId?: string;
151
+ text?: string;
152
+ canonicalText?: string;
153
+ formulation?: string;
154
+ rationale?: string;
155
+ worktreeId?: string;
156
+ pillar?: string;
157
+ baseRate: number;
158
+ sourceBeliefIds?: string[];
159
+ sourceType?: string;
160
+ beliefType?: string;
161
+ reversibility?: string;
162
+ predictionMeta?: JsonObject;
163
+ metadata?: JsonObject;
164
+ };
165
+ type BeliefsCompatForkInput = {
166
+ text?: string;
167
+ newFormulation?: string;
168
+ formulation?: string;
169
+ forkReason?: "refinement" | "contradiction_response" | "scope_change" | "confidence_collapse" | "manual";
170
+ rationale?: string;
171
+ };
172
+ type BeliefsCompatUpdateConfidenceInput = ModulateConfidenceInput;
173
+ /**
174
+ * Configuration for the high-level Lucern SDK client.
175
+ *
176
+ * At minimum, provide `apiKey` and `baseUrl`. The SDK handles
177
+ * authentication, retries, and idempotency automatically.
178
+ */
179
+ type LucernClientConfig = ClientConfig & {
180
+ /** API key for authenticating with the Lucern platform. */
181
+ apiKey?: string;
182
+ /**
183
+ * Optional Clerk JWT for per-user identity and RBAC.
184
+ * When present, the SDK operates in user-scoped mode with
185
+ * pack-aware tool filtering. When absent, operates in agent mode.
186
+ */
187
+ userToken?: string;
188
+ /**
189
+ * Optional pack key for auto-install convenience.
190
+ * When set, the SDK will call `packs.install()` on first use
191
+ * to ensure the pack is available in the workspace.
192
+ */
193
+ packKey?: string;
194
+ /** Target environment. Defaults to production if not specified. */
195
+ environment?: "sandbox" | "production";
196
+ };
197
+ /**
198
+ * Create the high-level Lucern SDK client with all domain namespaces.
199
+ *
200
+ * @param config - Client configuration with API key, base URL, and optional settings.
201
+ * @returns The Lucern client with namespaced methods for beliefs, topics, evidence, decisions, and more.
202
+ */
203
+ declare function createLucernClient(config?: LucernClientConfig): {
204
+ config: LucernClientConfig;
205
+ version: string;
206
+ search(query: string, options?: {
207
+ topicId?: string;
208
+ types?: string[];
209
+ status?: string;
210
+ minConfidence?: number;
211
+ limit?: number;
212
+ cursor?: string;
213
+ }): Promise<GatewayDataEnvelope<{
214
+ [x: string]: unknown;
215
+ } & {
216
+ cursor?: string;
217
+ total?: number;
218
+ } & {
219
+ beliefs?: {
220
+ [x: string]: unknown;
221
+ }[];
222
+ results?: {
223
+ [x: string]: unknown;
224
+ }[];
225
+ }>>;
226
+ events: {
227
+ list(query?: Parameters<(query?: {
228
+ topicId?: string;
229
+ after?: string;
230
+ types?: string[];
231
+ startTime?: number;
232
+ endTime?: number;
233
+ limit?: number;
234
+ }) => Promise<PlatformGatewaySuccess<{
235
+ [x: string]: unknown;
236
+ } & {
237
+ cursor?: string;
238
+ total?: number;
239
+ } & {
240
+ events?: {
241
+ [x: string]: unknown;
242
+ }[];
243
+ }>>>[0]): Promise<GatewayDataEnvelope<{
244
+ [x: string]: unknown;
245
+ } & {
246
+ cursor?: string;
247
+ total?: number;
248
+ } & {
249
+ events?: {
250
+ [x: string]: unknown;
251
+ }[];
252
+ }>>;
253
+ replay(input: Parameters<(input: {
254
+ [x: string]: unknown;
255
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
256
+ [x: string]: unknown;
257
+ }>>>[0]): Promise<GatewayDataEnvelope<{
258
+ [x: string]: unknown;
259
+ }>>;
260
+ };
261
+ beliefs: {
262
+ create(input: BeliefsCompatCreateInput): Promise<GatewayDataEnvelope<{
263
+ [x: string]: unknown;
264
+ } & {
265
+ id?: string;
266
+ beliefId?: string;
267
+ nodeId?: string;
268
+ }>>;
269
+ get(nodeId: string): Promise<GatewayDataEnvelope<{
270
+ [x: string]: unknown;
271
+ } & {
272
+ id?: string;
273
+ beliefId?: string;
274
+ nodeId?: string;
275
+ }>>;
276
+ refine(nodeId: string, textOrInput: string | {
277
+ text: string;
278
+ rationale?: string;
279
+ }, rationale?: string): Promise<GatewayDataEnvelope<{
280
+ [x: string]: unknown;
281
+ } & {
282
+ id?: string;
283
+ beliefId?: string;
284
+ nodeId?: string;
285
+ }>>;
286
+ updateConfidence(nodeId: string, input: BeliefsCompatUpdateConfidenceInput): Promise<GatewayDataEnvelope<{
287
+ [x: string]: unknown;
288
+ }>>;
289
+ modulateConfidence(nodeId: string, input: BeliefsCompatUpdateConfidenceInput): Promise<GatewayDataEnvelope<{
290
+ [x: string]: unknown;
291
+ }>>;
292
+ updateStatus(input: Parameters<(input: {
293
+ id?: string;
294
+ nodeId?: string;
295
+ beliefId?: string;
296
+ status: "active" | "superseded" | "archived";
297
+ reason?: string;
298
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
299
+ [x: string]: unknown;
300
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
301
+ [x: string]: unknown;
302
+ }>>;
303
+ updateRationale(input: Parameters<(input: {
304
+ id?: string;
305
+ nodeId?: string;
306
+ beliefId?: string;
307
+ rationale?: string;
308
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
309
+ [x: string]: unknown;
310
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
311
+ [x: string]: unknown;
312
+ }>>;
313
+ linkBeliefs(input: Parameters<(input: {
314
+ fromNodeId: string;
315
+ toNodeId: string;
316
+ edgeType: string;
317
+ weight?: number;
318
+ context?: string;
319
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
320
+ [x: string]: unknown;
321
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
322
+ [x: string]: unknown;
323
+ }>>;
324
+ unlinkEvidence(input: Parameters<(input: {
325
+ beliefNodeId?: string;
326
+ beliefId?: string;
327
+ insightId?: string;
328
+ evidenceId?: string;
329
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
330
+ [x: string]: unknown;
331
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
332
+ [x: string]: unknown;
333
+ }>>;
334
+ updateCriticality(input: Parameters<(input: {
335
+ id?: string;
336
+ nodeId?: string;
337
+ beliefId?: string;
338
+ criticality: string;
339
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
340
+ [x: string]: unknown;
341
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
342
+ [x: string]: unknown;
343
+ }>>;
344
+ batchUpdateCriticality(input: Parameters<(input: {
345
+ updates: {
346
+ [x: string]: unknown;
347
+ }[];
348
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
349
+ [x: string]: unknown;
350
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
351
+ [x: string]: unknown;
352
+ }>>;
353
+ reassignTopic(input: Parameters<(input: {
354
+ beliefNodeIds?: string[];
355
+ beliefIds?: string[];
356
+ targetTopicId: string;
357
+ reason?: string;
358
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
359
+ [x: string]: unknown;
360
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
361
+ [x: string]: unknown;
362
+ }>>;
363
+ fork(nodeId: string, input: BeliefsCompatForkInput): Promise<GatewayDataEnvelope<{
364
+ [x: string]: unknown;
365
+ } & {
366
+ id?: string;
367
+ beliefId?: string;
368
+ nodeId?: string;
369
+ }>>;
370
+ archive(nodeId: string, input?: string | {
371
+ reason?: string;
372
+ rationale?: string;
373
+ }): Promise<GatewayDataEnvelope<{
374
+ [x: string]: unknown;
375
+ }>>;
376
+ list(args: {
377
+ topicId?: string;
378
+ worktreeId?: string;
379
+ status?: string;
380
+ minConfidence?: number;
381
+ limit?: number;
382
+ cursor?: string;
383
+ }): Promise<GatewayDataEnvelope<{
384
+ [x: string]: unknown;
385
+ } & {
386
+ cursor?: string;
387
+ total?: number;
388
+ } & {
389
+ beliefs?: ({
390
+ [x: string]: unknown;
391
+ } & {
392
+ id?: string;
393
+ beliefId?: string;
394
+ nodeId?: string;
395
+ })[];
396
+ }>>;
397
+ search: (args: {
398
+ query: string;
399
+ topicId?: string;
400
+ status?: string;
401
+ minConfidence?: number;
402
+ limit?: number;
403
+ }) => Promise<{
404
+ results: Record<string, unknown>[];
405
+ }>;
406
+ lineage(nodeId: string): Promise<GatewayDataEnvelope<{
407
+ [x: string]: unknown;
408
+ } & {
409
+ beliefId?: string;
410
+ lineage?: {
411
+ [x: string]: unknown;
412
+ }[];
413
+ }>>;
414
+ confidenceHistory(nodeId: string): Promise<GatewayDataEnvelope<{
415
+ [x: string]: unknown;
416
+ }>>;
417
+ opinionHistory(nodeId: string): Promise<OpinionHistoryEntry[]>;
418
+ createContract(nodeId: string, input: Parameters<(id: string, input: {
419
+ [x: string]: unknown;
420
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
421
+ [x: string]: unknown;
422
+ }>>>[1]): Promise<GatewayDataEnvelope<{
423
+ [x: string]: unknown;
424
+ }>>;
425
+ bisect(nodeId: string, input: Parameters<(id: string, input: {
426
+ expectedDirection: "overconfident" | "underconfident";
427
+ timeRange?: {
428
+ start: number;
429
+ end: number;
430
+ };
431
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
432
+ [x: string]: unknown;
433
+ }>>>[1]): Promise<GatewayDataEnvelope<{
434
+ [x: string]: unknown;
435
+ }>>;
436
+ };
437
+ webhooks: {
438
+ create(input: Parameters<(input: {
439
+ [x: string]: unknown;
440
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
441
+ [x: string]: unknown;
442
+ }>>>[0]): Promise<GatewayDataEnvelope<{
443
+ [x: string]: unknown;
444
+ }>>;
445
+ list(query?: Parameters<(query?: {
446
+ topicId?: string;
447
+ }) => Promise<PlatformGatewaySuccess<{
448
+ [x: string]: unknown;
449
+ } & {
450
+ cursor?: string;
451
+ total?: number;
452
+ } & {
453
+ webhooks?: {
454
+ [x: string]: unknown;
455
+ }[];
456
+ }>>>[0]): Promise<GatewayDataEnvelope<{
457
+ [x: string]: unknown;
458
+ } & {
459
+ cursor?: string;
460
+ total?: number;
461
+ } & {
462
+ webhooks?: {
463
+ [x: string]: unknown;
464
+ }[];
465
+ }>>;
466
+ get(id: string): Promise<GatewayDataEnvelope<{
467
+ [x: string]: unknown;
468
+ }>>;
469
+ update(id: string, input: Parameters<(id: string, input: {
470
+ [x: string]: unknown;
471
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
472
+ [x: string]: unknown;
473
+ }>>>[1]): Promise<GatewayDataEnvelope<{
474
+ [x: string]: unknown;
475
+ }>>;
476
+ delete(id: string): Promise<GatewayDataEnvelope<{
477
+ [x: string]: unknown;
478
+ }>>;
479
+ test(id: string, input?: Parameters<(id: string, input?: {
480
+ topicId?: string;
481
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
482
+ [x: string]: unknown;
483
+ }>>>[1]): Promise<GatewayDataEnvelope<{
484
+ [x: string]: unknown;
485
+ }>>;
486
+ deliveries(id: string, query?: Parameters<(id: string, query?: {
487
+ limit?: number;
488
+ }) => Promise<PlatformGatewaySuccess<{
489
+ [x: string]: unknown;
490
+ }>>>[1]): Promise<GatewayDataEnvelope<{
491
+ [x: string]: unknown;
492
+ }>>;
493
+ health(id: string): Promise<GatewayDataEnvelope<{
494
+ [x: string]: unknown;
495
+ }>>;
496
+ };
497
+ edges: {
498
+ create(args: {
499
+ sourceId: string;
500
+ targetId: string;
501
+ edgeType: string;
502
+ topicId?: string;
503
+ confidence?: number;
504
+ weight?: number;
505
+ context?: string;
506
+ reasoning?: string;
507
+ }): Promise<GatewayDataEnvelope<{
508
+ [x: string]: unknown;
509
+ }>>;
510
+ update(input: Parameters<(input: {
511
+ edgeId: string;
512
+ weight?: number;
513
+ confidence?: number;
514
+ context?: string;
515
+ derivationType?: string;
516
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
517
+ [x: string]: unknown;
518
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
519
+ [x: string]: unknown;
520
+ }>>;
521
+ remove(input: Parameters<(input: {
522
+ edgeId: string;
523
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
524
+ [x: string]: unknown;
525
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
526
+ [x: string]: unknown;
527
+ }>>;
528
+ removeBetween(input: Parameters<(input: {
529
+ fromNodeId: string;
530
+ toNodeId: string;
531
+ edgeType?: string;
532
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
533
+ [x: string]: unknown;
534
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
535
+ [x: string]: unknown;
536
+ }>>;
537
+ batchCreate(input: Parameters<(input: {
538
+ edges: {
539
+ [x: string]: unknown;
540
+ }[];
541
+ skipLayerValidation?: boolean;
542
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
543
+ [x: string]: unknown;
544
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
545
+ [x: string]: unknown;
546
+ }>>;
547
+ delete(input: Parameters<(input: {
548
+ edgeIds: string[];
549
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
550
+ [x: string]: unknown;
551
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
552
+ [x: string]: unknown;
553
+ }>>;
554
+ list(args: {
555
+ sourceId: string;
556
+ edgeType?: string;
557
+ limit?: number;
558
+ cursor?: string;
559
+ }): Promise<GatewayDataEnvelope<{
560
+ [x: string]: unknown;
561
+ } & {
562
+ cursor?: string;
563
+ total?: number;
564
+ }>>;
565
+ traverse(args: {
566
+ startNode: string;
567
+ direction?: string;
568
+ maxDepth?: number;
569
+ topicId?: string;
570
+ }): Promise<GatewayDataEnvelope<{
571
+ [x: string]: unknown;
572
+ }>>;
573
+ };
574
+ evidence: {
575
+ create(args: {
576
+ text?: string;
577
+ canonicalText?: string;
578
+ topicId?: string;
579
+ source?: string;
580
+ sourceUrl?: string;
581
+ targetId?: string;
582
+ weight?: number;
583
+ metadata?: JsonObject;
584
+ title?: string;
585
+ content?: string;
586
+ contentType?: string;
587
+ kind?: string;
588
+ supports?: {
589
+ nodeId: string;
590
+ weight: number;
591
+ reasoning?: string;
592
+ };
593
+ }): Promise<GatewayDataEnvelope<{
594
+ [x: string]: unknown;
595
+ } & {
596
+ id?: string;
597
+ }>>;
598
+ add: (args: {
599
+ text?: string;
600
+ canonicalText?: string;
601
+ topicId?: string;
602
+ source?: string;
603
+ sourceUrl?: string;
604
+ targetId?: string;
605
+ weight?: number;
606
+ metadata?: JsonObject;
607
+ title?: string;
608
+ content?: string;
609
+ contentType?: string;
610
+ kind?: string;
611
+ supports?: {
612
+ nodeId: string;
613
+ weight: number;
614
+ reasoning?: string;
615
+ };
616
+ }) => Promise<{
617
+ [x: string]: unknown;
618
+ } & {
619
+ id?: string;
620
+ }>;
621
+ get(evidenceId: string): Promise<GatewayDataEnvelope<{
622
+ [x: string]: unknown;
623
+ }>>;
624
+ list(args: {
625
+ topicId?: string;
626
+ targetId?: string;
627
+ limit?: number;
628
+ cursor?: string;
629
+ }): Promise<GatewayDataEnvelope<{
630
+ [x: string]: unknown;
631
+ } & {
632
+ cursor?: string;
633
+ total?: number;
634
+ }>>;
635
+ search(args: {
636
+ q?: string;
637
+ query?: string;
638
+ topicId?: string;
639
+ targetId?: string;
640
+ methodology?: string;
641
+ limit?: number;
642
+ cursor?: string;
643
+ }): Promise<GatewayDataEnvelope<{
644
+ [x: string]: unknown;
645
+ } & {
646
+ cursor?: string;
647
+ total?: number;
648
+ }>>;
649
+ link(args: {
650
+ evidenceId: string;
651
+ targetId?: string;
652
+ beliefId?: string;
653
+ questionId?: string;
654
+ targetType?: "belief" | "question" | string;
655
+ weight?: number;
656
+ rationale?: string;
657
+ }): Promise<GatewayDataEnvelope<{
658
+ [x: string]: unknown;
659
+ } & {
660
+ edgeId?: string;
661
+ }>>;
662
+ linkToBelief(args: {
663
+ evidenceId: string;
664
+ beliefId: string;
665
+ weight: number;
666
+ rationale?: string;
667
+ }): Promise<{
668
+ beliefId: string;
669
+ edgeId?: string;
670
+ }>;
671
+ classifyEvidence(beliefId: string, evidenceId: string, config?: Parameters<(beliefId: string, evidenceId: string, classificationConfig?: EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<ClassifyEvidenceResult>>>[2], idempotencyKey?: string): Promise<GatewayDataEnvelope<ClassifyEvidenceResult>>;
672
+ classifyEvidenceBatch(beliefId: string, evidence: Parameters<(beliefId: string, evidence: ClassifyEvidenceBatchItem[], classificationConfig?: EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<ClassifyEvidenceBatchResult>>>[1], config?: Parameters<(beliefId: string, evidence: ClassifyEvidenceBatchItem[], classificationConfig?: EvidenceClassificationRequestConfig, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<ClassifyEvidenceBatchResult>>>[2], idempotencyKey?: string): Promise<GatewayDataEnvelope<ClassifyEvidenceBatchResult>>;
673
+ updateStatus(input: Parameters<(input: {
674
+ [x: string]: unknown;
675
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
676
+ [x: string]: unknown;
677
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
678
+ [x: string]: unknown;
679
+ }>>;
680
+ update(input: Parameters<(input: {
681
+ [x: string]: unknown;
682
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
683
+ [x: string]: unknown;
684
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
685
+ [x: string]: unknown;
686
+ }>>;
687
+ flagIncorrect(input: Parameters<(input: {
688
+ [x: string]: unknown;
689
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
690
+ [x: string]: unknown;
691
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
692
+ [x: string]: unknown;
693
+ }>>;
694
+ remove(input: Parameters<(input: {
695
+ [x: string]: unknown;
696
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
697
+ [x: string]: unknown;
698
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
699
+ [x: string]: unknown;
700
+ }>>;
701
+ updateVerificationStatus(input: Parameters<(input: {
702
+ [x: string]: unknown;
703
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
704
+ [x: string]: unknown;
705
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
706
+ [x: string]: unknown;
707
+ }>>;
708
+ };
709
+ sources: {
710
+ upsert(input: Parameters<(spec: UpsertSourceSpec, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PlatformSourceRecord>>>[0], idempotencyKey?: Parameters<(spec: UpsertSourceSpec, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PlatformSourceRecord>>>[1]): Promise<GatewayDataEnvelope<PlatformSourceRecord>>;
711
+ get(sourceId: string): Promise<GatewayDataEnvelope<PlatformSourceRecord>>;
712
+ };
713
+ questions: {
714
+ create(args: {
715
+ text: string;
716
+ topicId?: string;
717
+ priority?: string;
718
+ linkedBeliefId?: string;
719
+ metadata?: JsonObject;
720
+ }): Promise<GatewayDataEnvelope<{
721
+ [x: string]: unknown;
722
+ }>>;
723
+ get(questionId: string): Promise<GatewayDataEnvelope<{
724
+ [x: string]: unknown;
725
+ }>>;
726
+ refine(questionId: string, text: string, refinementReason?: string): Promise<GatewayDataEnvelope<{
727
+ [x: string]: unknown;
728
+ }>>;
729
+ list(args: {
730
+ topicId?: string;
731
+ status?: string;
732
+ priority?: string;
733
+ worktreeId?: string;
734
+ limit?: number;
735
+ cursor?: string;
736
+ }): Promise<GatewayDataEnvelope<{
737
+ [x: string]: unknown;
738
+ } & {
739
+ cursor?: string;
740
+ total?: number;
741
+ } & {
742
+ questions?: Array<{
743
+ [x: string]: unknown;
744
+ } & {
745
+ priority?: string;
746
+ }>;
747
+ }>>;
748
+ updateStatus(questionId: string, status: string, rationale?: string): Promise<GatewayDataEnvelope<{
749
+ [x: string]: unknown;
750
+ }>>;
751
+ batchCreate(input: Parameters<(input: {
752
+ [x: string]: unknown;
753
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
754
+ [x: string]: unknown;
755
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
756
+ [x: string]: unknown;
757
+ }>>;
758
+ add(input: Parameters<(input: {
759
+ [x: string]: unknown;
760
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
761
+ [x: string]: unknown;
762
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
763
+ [x: string]: unknown;
764
+ }>>;
765
+ updatePriority(input: Parameters<(input: {
766
+ [x: string]: unknown;
767
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
768
+ [x: string]: unknown;
769
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
770
+ [x: string]: unknown;
771
+ }>>;
772
+ advanceToConviction(input: Parameters<(input: {
773
+ [x: string]: unknown;
774
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
775
+ [x: string]: unknown;
776
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
777
+ [x: string]: unknown;
778
+ }>>;
779
+ updateConviction(input: Parameters<(input: {
780
+ [x: string]: unknown;
781
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
782
+ [x: string]: unknown;
783
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
784
+ [x: string]: unknown;
785
+ }>>;
786
+ finalizeConviction(input: Parameters<(input: {
787
+ [x: string]: unknown;
788
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
789
+ [x: string]: unknown;
790
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
791
+ [x: string]: unknown;
792
+ }>>;
793
+ update(input: Parameters<(input: {
794
+ [x: string]: unknown;
795
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
796
+ [x: string]: unknown;
797
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
798
+ [x: string]: unknown;
799
+ }>>;
800
+ delete(input: Parameters<(input: {
801
+ [x: string]: unknown;
802
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
803
+ [x: string]: unknown;
804
+ }>>>[0], idempotencyKey?: string): Promise<GatewayDataEnvelope<{
805
+ [x: string]: unknown;
806
+ }>>;
807
+ answer(questionId: string, input: {
808
+ text: string;
809
+ confidence?: string;
810
+ evidenceIds?: string[];
811
+ rationale?: string;
812
+ }): Promise<GatewayDataEnvelope<{
813
+ [x: string]: unknown;
814
+ }>>;
815
+ archive(questionId: string, reason?: string): Promise<GatewayDataEnvelope<{
816
+ [x: string]: unknown;
817
+ }>>;
818
+ linkEvidence(args: {
819
+ evidenceId: string;
820
+ questionId: string;
821
+ relevance?: number;
822
+ weight?: number;
823
+ rationale?: string;
824
+ }): Promise<{
825
+ questionId: string;
826
+ relevance: number | undefined;
827
+ edgeId?: string;
828
+ }>;
829
+ getHighPriority(args: {
830
+ topicId?: string;
831
+ limit?: number;
832
+ includeAnswered?: boolean;
833
+ }): Promise<{
834
+ questions: ({
835
+ priority?: string;
836
+ } & Record<string, unknown>)[];
837
+ }>;
838
+ findMissing(args: {
839
+ topicId?: string;
840
+ minConfidence?: number;
841
+ }): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
842
+ };
843
+ graph: {
844
+ nodes: {
845
+ list(query: Parameters<(query: ListNodesInput) => Promise<PlatformGatewaySuccess<ListResult<PlatformGraphNode, "nodes">>>>[0]): Promise<PlatformGatewaySuccess<ListResult<PlatformGraphNode, "nodes">>>;
846
+ get(input: string | Parameters<(query: GetNodeInput) => Promise<PlatformGatewaySuccess<PlatformGraphNode>>>[0]): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
847
+ create(input: Parameters<(input: CreateNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PlatformGraphNode>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
848
+ update(input: Parameters<(input: UpdateNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PlatformGraphNode>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
849
+ batchCreate(input: Parameters<(input: BatchCreateNodesInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
850
+ supersede(input: Parameters<(input: SupersedeNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
851
+ verify(input: Parameters<(input: VerifyNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
852
+ hardDelete(input: Parameters<(input: HardDeleteNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
853
+ };
854
+ createEdge(input: Parameters<(input: CreateEdgeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PlatformGraphEdge>>>[0]): Promise<PlatformGatewaySuccess<PlatformGraphEdge>>;
855
+ neighborhood(args: Parameters<(query: NeighborhoodInput) => Promise<PlatformGatewaySuccess<GraphNeighborhoodResponse>>>[0]): Promise<GatewayDataEnvelope<GraphNeighborhoodResponse>>;
856
+ queryLineage: (nodeId: string, depth?: number) => Promise<{
857
+ chain: {
858
+ nodeId: {};
859
+ relation: string;
860
+ }[];
861
+ forkTree: {
862
+ nodeId: string;
863
+ parentCount: number;
864
+ childCount: number;
865
+ children: never[];
866
+ };
867
+ depth: number;
868
+ beliefId: string | undefined;
869
+ lineage: {
870
+ [x: string]: unknown;
871
+ }[];
872
+ }>;
873
+ getConfidenceHistory: (nodeId: string) => Promise<GatewayDataEnvelope<{
874
+ [x: string]: unknown;
875
+ }>>;
876
+ getOpinionHistory: (nodeId: string) => Promise<OpinionHistoryEntry[]>;
877
+ getAuditTrail: (nodeId: string, limit?: number) => Promise<{
878
+ entries: {
879
+ action: string;
880
+ actor: string;
881
+ timestamp: number;
882
+ rationale: string;
883
+ before: string | number | boolean | JsonObject | JsonArray | null;
884
+ after: string | number | boolean | JsonObject | JsonArray | null;
885
+ }[];
886
+ }>;
887
+ traverse(args: {
888
+ startNode: string;
889
+ direction?: string;
890
+ maxDepth?: number;
891
+ topicId?: string;
892
+ }): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
893
+ analyze(args: {
894
+ topicId?: string;
895
+ limit?: number;
896
+ metric?: string;
897
+ }): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
898
+ bias(args: {
899
+ topicId?: string;
900
+ threshold?: number;
901
+ limit?: number;
902
+ }): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
903
+ gaps(args: {
904
+ topicId?: string;
905
+ minConfidence?: number;
906
+ }): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
907
+ falsify(args: {
908
+ topicId?: string;
909
+ beliefId?: string;
910
+ beliefIds?: string[];
911
+ minConfidence?: number;
912
+ }): Promise<GatewayDataEnvelope<{
913
+ [x: string]: unknown;
914
+ }>>;
915
+ traceEntityImpact(args: {
916
+ nodeId: string;
917
+ topicId?: string;
918
+ }): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
919
+ searchBeliefs: (args: {
920
+ query: string;
921
+ topicId?: string;
922
+ status?: string;
923
+ minConfidence?: number;
924
+ limit?: number;
925
+ }) => Promise<{
926
+ results: Record<string, unknown>[];
927
+ }>;
928
+ findContradictions: (args: {
929
+ topicId?: string;
930
+ nodeId?: string;
931
+ status?: string;
932
+ }) => Promise<{
933
+ contradictions: {
934
+ beliefA: string;
935
+ beliefB: string;
936
+ description: string;
937
+ severity: string;
938
+ status: string;
939
+ defeatType: string;
940
+ }[];
941
+ }>;
942
+ bisectConfidence: (nodeId: string, args: {
943
+ expectedDirection: "overconfident" | "underconfident";
944
+ }) => Promise<GatewayDataEnvelope<{
945
+ [x: string]: unknown;
946
+ }>>;
947
+ listBeliefs: (args: {
948
+ topicId?: string;
949
+ worktreeId?: string;
950
+ status?: string;
951
+ minConfidence?: number;
952
+ limit?: number;
953
+ cursor?: string;
954
+ }) => Promise<({
955
+ [x: string]: unknown;
956
+ } & {
957
+ id?: string;
958
+ beliefId?: string;
959
+ nodeId?: string;
960
+ })[]>;
961
+ detectConfirmationBias(topicId: string, threshold?: number): Promise<{
962
+ topicId: string;
963
+ threshold: number;
964
+ success: true;
965
+ data: Record<string, unknown>;
966
+ correlationId: string;
967
+ policyTraceId: string | null;
968
+ idempotentReplay: boolean;
969
+ }>;
970
+ getStructureAnalysis(topicId: string): Promise<{
971
+ topicId: string;
972
+ success: true;
973
+ data: Record<string, unknown>;
974
+ correlationId: string;
975
+ policyTraceId: string | null;
976
+ idempotentReplay: boolean;
977
+ }>;
978
+ getFalsificationQuestions(topicId: string, beliefIds?: string[]): Promise<{
979
+ topicId: string;
980
+ questions: unknown;
981
+ }>;
982
+ };
983
+ judgments: {
984
+ create(input: RecordJudgmentInput): Promise<PlatformGatewaySuccess<RecordJudgmentResponse>>;
985
+ record(input: RecordJudgmentInput): Promise<PlatformGatewaySuccess<RecordJudgmentResponse>>;
986
+ list(query: Parameters<(query: ListJudgmentsInput) => Promise<PlatformGatewaySuccess<ListJudgmentsResponse>>>[0]): Promise<PlatformGatewaySuccess<ListJudgmentsResponse>>;
987
+ get(judgmentId: string): Promise<PlatformGatewaySuccess<GetJudgmentResponse>>;
988
+ recordOutcome(judgmentId: string, input: Parameters<(judgmentId: string, input: RecordJudgmentOutcomeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<RecordJudgmentOutcomeResponse>>>[1]): Promise<PlatformGatewaySuccess<RecordJudgmentOutcomeResponse>>;
989
+ updateOutcome(judgmentId: string, input: Parameters<(judgmentId: string, input: RecordJudgmentOutcomeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<RecordJudgmentOutcomeResponse>>>[1]): Promise<PlatformGatewaySuccess<RecordJudgmentOutcomeResponse>>;
990
+ readiness(topicId: string): Promise<PlatformGatewaySuccess<JudgmentReadinessResponse>>;
991
+ calibration(topicId: string): Promise<PlatformGatewaySuccess<JudgmentCalibrationResponse>>;
992
+ pendingOutcomeReview(topicId: string): Promise<PlatformGatewaySuccess<ListResult<PendingJudgmentOutcomeRecord, "reviews">>>;
993
+ transitionAuditIntegrity(args: {
994
+ topicId?: string;
995
+ judgmentId?: string;
996
+ includePassing?: boolean;
997
+ }): Promise<PlatformGatewaySuccess<JudgmentTransitionAuditIntegrityResponse>>;
998
+ };
999
+ worktrees: {
1000
+ createBranch(input: Parameters<(input: {
1001
+ name: string;
1002
+ topicId?: string;
1003
+ description?: string;
1004
+ metadata?: JsonObject;
1005
+ } & TopicIdentifierInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<WorkflowBranchRecord>>>[0]): Promise<PlatformGatewaySuccess<WorkflowBranchRecord>>;
1006
+ createLens(input: Parameters<(input: {
1007
+ name: string;
1008
+ workspaceId?: string;
1009
+ topicId?: string;
1010
+ description?: string;
1011
+ perspectiveType: WorkflowLensPerspectiveType;
1012
+ promptTemplates?: LensPromptTemplateReference[];
1013
+ workflowTemplates?: LensWorkflowTemplate[];
1014
+ taskTemplates?: LensTaskTemplate[];
1015
+ filterCriteria?: JsonObject;
1016
+ } & TopicIdentifierInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<WorkflowLensRecord>>>[0]): Promise<PlatformGatewaySuccess<WorkflowLensRecord>>;
1017
+ listLenses(query: Parameters<(query: {
1018
+ workspaceId?: string;
1019
+ topicId?: string;
1020
+ status?: WorkflowLensStatus;
1021
+ perspectiveType?: WorkflowLensPerspectiveType;
1022
+ } & TopicIdentifierInput) => Promise<PlatformGatewaySuccess<ListResult<WorkflowLensRecord, "lenses">>>>[0]): Promise<PlatformGatewaySuccess<ListResult<WorkflowLensRecord, "lenses">>>;
1023
+ applyLensToTopic(input: Parameters<(input: {
1024
+ lensId: string;
1025
+ topicId?: string;
1026
+ metadata?: JsonObject;
1027
+ } & TopicIdentifierInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<WorkflowLensBindingRecord>>>[0]): Promise<PlatformGatewaySuccess<WorkflowLensBindingRecord>>;
1028
+ removeLensFromTopic(input: Parameters<(input: {
1029
+ lensId: string;
1030
+ topicId?: string;
1031
+ } & TopicIdentifierInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<WorkflowLensBindingRecord>>>[0]): Promise<PlatformGatewaySuccess<WorkflowLensBindingRecord>>;
1032
+ create(input: AddWorktreeInput): Promise<PlatformGatewaySuccess<{
1033
+ [x: string]: unknown;
1034
+ }>>;
1035
+ add(input: AddWorktreeInput): Promise<PlatformGatewaySuccess<{
1036
+ [x: string]: unknown;
1037
+ }>>;
1038
+ list(query: Parameters<(query: {
1039
+ topicId?: string;
1040
+ branchId?: string;
1041
+ status?: WorkflowWorktreeStatus;
1042
+ track?: string;
1043
+ executionBand?: number;
1044
+ limit?: number;
1045
+ } & TopicIdentifierInput) => Promise<PlatformGatewaySuccess<ListResult<WorkflowWorktreeRecord, "worktrees">>>>[0]): Promise<PlatformGatewaySuccess<{
1046
+ [x: string]: unknown;
1047
+ } & {
1048
+ cursor?: string;
1049
+ total?: number;
1050
+ } & {
1051
+ worktrees?: {
1052
+ [x: string]: unknown;
1053
+ }[];
1054
+ }>>;
1055
+ activate(worktreeId: string): Promise<PlatformGatewaySuccess<{
1056
+ [x: string]: unknown;
1057
+ }>>;
1058
+ updateMetadata(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<{
1059
+ [x: string]: unknown;
1060
+ }>>;
1061
+ update(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<{
1062
+ [x: string]: unknown;
1063
+ }>>;
1064
+ updateTargets(input: Parameters<(input: UpdateWorktreeTargetsInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<WorkflowWorktreeRecord>>>[0]): Promise<PlatformGatewaySuccess<{
1065
+ [x: string]: unknown;
1066
+ }>>;
1067
+ listAll(query?: Parameters<(query?: {
1068
+ status?: WorkflowWorktreeStatus;
1069
+ track?: string;
1070
+ executionBand?: number;
1071
+ limit?: number;
1072
+ }) => Promise<PlatformGatewaySuccess<ListWorktreesResponse>>>[0]): Promise<PlatformGatewaySuccess<ListWorktreesResponse>>;
1073
+ merge(worktreeId: string, input: MergeInput): Promise<PlatformGatewaySuccess<{
1074
+ [x: string]: unknown;
1075
+ }>>;
1076
+ push(worktreeId: string, input: Parameters<(worktreeId: string, input: {
1077
+ targetContext: string;
1078
+ beliefIds?: string[];
1079
+ metadata?: JsonObject;
1080
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PushWorktreeResponse>>>[1]): Promise<PlatformGatewaySuccess<PushWorktreeResponse>>;
1081
+ openPullRequest(worktreeId: string, input: Parameters<(worktreeId: string, input: {
1082
+ summary: string;
1083
+ reviewers?: string[];
1084
+ status?: "pending_review" | "changes_requested" | "approved" | "blocked";
1085
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<OpenPullRequestResponse>>>[1]): Promise<PlatformGatewaySuccess<OpenPullRequestResponse>>;
1086
+ pipelineSnapshot(topicId: string): FunctionSurfaceResult<unknown>;
1087
+ complete(input: Parameters<(input: {
1088
+ worktreeId: string;
1089
+ keyFindings?: string[];
1090
+ decisionsReached?: string[];
1091
+ nextSteps?: string[];
1092
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
1093
+ [x: string]: unknown;
1094
+ }>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<{
1095
+ [x: string]: unknown;
1096
+ }>>;
1097
+ advancePhase(worktreeId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<{
1098
+ [x: string]: unknown;
1099
+ }>>;
1100
+ setPhase(worktreeId: string, phase: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<{
1101
+ [x: string]: unknown;
1102
+ }>>;
1103
+ patchState(input: Parameters<(input: {
1104
+ worktreeId: string;
1105
+ patch: {
1106
+ [x: string]: unknown;
1107
+ };
1108
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
1109
+ [x: string]: unknown;
1110
+ }>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<{
1111
+ [x: string]: unknown;
1112
+ }>>;
1113
+ bulkCreate(input: Parameters<(input: {
1114
+ worktrees: unknown[];
1115
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
1116
+ [x: string]: unknown;
1117
+ }>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<{
1118
+ [x: string]: unknown;
1119
+ }>>;
1120
+ };
1121
+ context: {
1122
+ listTopics(query?: Parameters<(query?: TopicListInput) => Promise<PlatformGatewaySuccess<TopicListResponse>>>[0]): Promise<PlatformGatewaySuccess<TopicListResponse>>;
1123
+ compile(topicId: string, input?: Parameters<(topicId: string, input?: CompileContextInput) => Promise<PlatformGatewaySuccess<PublicCompiledContext>>>[1]): Promise<PlatformGatewaySuccess<PublicCompiledContext>>;
1124
+ recordScopeLearning(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1125
+ discover(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1126
+ analyzeTopicDensity(input: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1127
+ applyAutoBranching(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1128
+ seedBeliefLattice(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1129
+ getLatticeCoverage(input?: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1130
+ matchEntityType(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<{
1131
+ [x: string]: unknown;
1132
+ }>>;
1133
+ discoverEntityConnections(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1134
+ triggerBeliefReview(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1135
+ };
1136
+ tasks: {
1137
+ create(input: CreateTaskInput): Promise<PlatformGatewaySuccess<{
1138
+ [x: string]: unknown;
1139
+ }>>;
1140
+ complete(taskId: string, input: CompleteTaskInput): Promise<PlatformGatewaySuccess<{
1141
+ [x: string]: unknown;
1142
+ }>>;
1143
+ update(taskId: string, input: UpdateTaskInput): Promise<PlatformGatewaySuccess<{
1144
+ [x: string]: unknown;
1145
+ }>>;
1146
+ list(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<{
1147
+ [x: string]: unknown;
1148
+ } & {
1149
+ cursor?: string;
1150
+ total?: number;
1151
+ } & {
1152
+ tasks?: {
1153
+ [x: string]: unknown;
1154
+ }[];
1155
+ }>>;
1156
+ };
1157
+ topics: {
1158
+ list(input?: Parameters<(query?: TopicListInput) => Promise<PlatformGatewaySuccess<TopicListResponse>>>[0]): Promise<PlatformGatewaySuccess<TopicListResponse>>;
1159
+ get(topicId: string): Promise<PlatformGatewaySuccess<TopicRecord>>;
1160
+ create(input: Parameters<(input: TopicCreateInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<TopicRecord>>>[0]): Promise<PlatformGatewaySuccess<TopicRecord>>;
1161
+ update(topicId: string, input: Parameters<(topicId: string, input: TopicUpdateInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<TopicRecord>>>[1]): Promise<PlatformGatewaySuccess<TopicRecord>>;
1162
+ tree(topicId: string, query?: Parameters<(topicId: string, query?: TopicTreeQuery) => Promise<PlatformGatewaySuccess<TopicTreeResponse>>>[1]): Promise<PlatformGatewaySuccess<TopicTreeResponse>>;
1163
+ getTree(input: {
1164
+ rootId: string;
1165
+ maxDepth?: number;
1166
+ }): Promise<PlatformGatewaySuccess<TopicTreeResponse>>;
1167
+ coverage(topicId: string, query?: Parameters<(topicId: string, query?: TopicCoverageQuery) => Promise<PlatformGatewaySuccess<TopicCoverageResponse>>>[1]): Promise<PlatformGatewaySuccess<TopicCoverageResponse>>;
1168
+ remove(topicId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1169
+ bulkCreate(input: Parameters<(input: TopicBulkCreateInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1170
+ };
1171
+ answers: {
1172
+ create(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<{
1173
+ [x: string]: unknown;
1174
+ }>>;
1175
+ get(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1176
+ };
1177
+ contradictions: {
1178
+ flag(args: {
1179
+ beliefA: string;
1180
+ beliefB: string;
1181
+ description: string;
1182
+ topicId?: string;
1183
+ severity?: string;
1184
+ defeatType?: string;
1185
+ }): Promise<GatewayDataEnvelope<{
1186
+ [x: string]: unknown;
1187
+ }>>;
1188
+ list(args: {
1189
+ topicId?: string;
1190
+ status?: string;
1191
+ limit?: number;
1192
+ cursor?: string;
1193
+ }): Promise<GatewayDataEnvelope<{
1194
+ [x: string]: unknown;
1195
+ } & {
1196
+ cursor?: string;
1197
+ total?: number;
1198
+ } & {
1199
+ contradictions?: {
1200
+ [x: string]: unknown;
1201
+ }[];
1202
+ }>>;
1203
+ get(contradictionId: string): Promise<GatewayDataEnvelope<{
1204
+ [x: string]: unknown;
1205
+ }>>;
1206
+ find: (args: {
1207
+ topicId?: string;
1208
+ nodeId?: string;
1209
+ status?: string;
1210
+ }) => Promise<{
1211
+ contradictions: {
1212
+ beliefA: string;
1213
+ beliefB: string;
1214
+ description: string;
1215
+ severity: string;
1216
+ status: string;
1217
+ defeatType: string;
1218
+ }[];
1219
+ }>;
1220
+ };
1221
+ ontologies: {
1222
+ list(input?: {
1223
+ tenantId?: string;
1224
+ tier?: string;
1225
+ status?: string;
1226
+ }): Promise<GatewayDataEnvelope<{
1227
+ ontologies: any[];
1228
+ total: number;
1229
+ items: any[];
1230
+ definitions: any[];
1231
+ }>>;
1232
+ get(ontologyId: string): Promise<GatewayDataEnvelope<{
1233
+ [x: string]: unknown;
1234
+ }>>;
1235
+ bind(input: Parameters<(input: OntologyBindingInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
1236
+ [x: string]: unknown;
1237
+ }>>>[0], idempotencyKey?: Parameters<(input: OntologyBindingInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
1238
+ [x: string]: unknown;
1239
+ }>>>[1]): Promise<GatewayDataEnvelope<{
1240
+ [x: string]: unknown;
1241
+ }>>;
1242
+ match(input: Parameters<(input: {
1243
+ [x: string]: unknown;
1244
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
1245
+ [x: string]: unknown;
1246
+ }>>>[0], idempotencyKey?: Parameters<(input: {
1247
+ [x: string]: unknown;
1248
+ }, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<{
1249
+ [x: string]: unknown;
1250
+ }>>>[1]): Promise<GatewayDataEnvelope<{
1251
+ [x: string]: unknown;
1252
+ }>>;
1253
+ create(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
1254
+ update(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
1255
+ archive(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
1256
+ createVersion(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
1257
+ publishVersion(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1258
+ publishOntologyVersion(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1259
+ deprecateVersion(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1260
+ deprecateOntologyVersion(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1261
+ resolveEffective(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1262
+ resolveEffectiveOntology(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1263
+ raw: {
1264
+ list(filters?: GatewayScope & {
1265
+ tenantId?: string;
1266
+ tier?: string;
1267
+ status?: string;
1268
+ }): Promise<PlatformGatewaySuccess<{
1269
+ ontologies: any[];
1270
+ total: number;
1271
+ items: any[];
1272
+ definitions: any[];
1273
+ }>>;
1274
+ get(id: string): Promise<PlatformGatewaySuccess<unknown>>;
1275
+ bind(input: OntologyBindingInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1276
+ listDefinitions(filters?: GatewayScope & {
1277
+ tenantId?: string;
1278
+ tier?: string;
1279
+ status?: string;
1280
+ }): Promise<PlatformGatewaySuccess<{
1281
+ ontologies: any[];
1282
+ total: number;
1283
+ items: any[];
1284
+ definitions: any[];
1285
+ }>>;
1286
+ getDefinition(id: string): Promise<PlatformGatewaySuccess<unknown>>;
1287
+ createDefinition(input: OntologyDefinitionInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1288
+ updateDefinition(id: string, input: OntologyDefinitionUpdateInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1289
+ archiveDefinition(id: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1290
+ listVersions(ontologyId: string, filters?: GatewayScope & {
1291
+ status?: string;
1292
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "versions">>>;
1293
+ createVersion(ontologyId: string, input: OntologyVersionInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1294
+ publishVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1295
+ deprecateVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1296
+ listTopics(ontologyId: string): Promise<PlatformGatewaySuccess<ListResult<any, "topics">>>;
1297
+ listTopicsByOntology(ontologyId: string): Promise<PlatformGatewaySuccess<ListResult<any, "topics">>>;
1298
+ };
1299
+ };
1300
+ coordination: {
1301
+ registerSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1302
+ heartbeatSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1303
+ endSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1304
+ listActiveSessions(input?: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1305
+ sendAgentMessage(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1306
+ broadcastMessage(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1307
+ getInbox(input?: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1308
+ getAgentInbox(input?: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1309
+ claimFiles(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1310
+ };
1311
+ policy: {
1312
+ checkPermission(input: FunctionSurfaceInput): Promise<PlatformGatewaySuccess<PermissionDecision>>;
1313
+ listAccessibleTopics(input?: Parameters<(query?: GatewayScope & {
1314
+ permission?: PermissionKind;
1315
+ includeShared?: boolean;
1316
+ principal?: string;
1317
+ principalId?: string;
1318
+ limit?: number;
1319
+ }) => Promise<{
1320
+ data: {
1321
+ permission: PermissionKind;
1322
+ topics: {
1323
+ [key: string]: unknown;
1324
+ topicId?: string;
1325
+ name?: string;
1326
+ type?: string;
1327
+ isOwner?: boolean;
1328
+ }[];
1329
+ total: number;
1330
+ deniedTopics: {
1331
+ topicId: string;
1332
+ reasonCode: string;
1333
+ }[];
1334
+ };
1335
+ success: true;
1336
+ correlationId: string;
1337
+ policyTraceId: string | null;
1338
+ idempotentReplay: boolean;
1339
+ }>>[0]): Promise<{
1340
+ data: {
1341
+ permission: PermissionKind;
1342
+ topics: {
1343
+ [key: string]: unknown;
1344
+ topicId?: string;
1345
+ name?: string;
1346
+ type?: string;
1347
+ isOwner?: boolean;
1348
+ }[];
1349
+ total: number;
1350
+ deniedTopics: {
1351
+ topicId: string;
1352
+ reasonCode: string;
1353
+ }[];
1354
+ };
1355
+ success: true;
1356
+ correlationId: string;
1357
+ policyTraceId: string | null;
1358
+ idempotentReplay: boolean;
1359
+ }>;
1360
+ filterByPermission(input: FunctionSurfaceInput): Promise<{
1361
+ success: boolean;
1362
+ data: {
1363
+ permission: PermissionKind;
1364
+ allowedTopicIds: string[];
1365
+ deniedTopics: {
1366
+ topicId: string;
1367
+ reasonCode: string;
1368
+ }[];
1369
+ count: number;
1370
+ };
1371
+ }>;
1372
+ manageWritePolicy(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1373
+ raw: {
1374
+ listDecisions(query?: GatewayScope & {
1375
+ action?: string;
1376
+ decision?: string;
1377
+ traceId?: string;
1378
+ principalId?: string;
1379
+ topicId?: string;
1380
+ limit?: number;
1381
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "decisions">>>;
1382
+ grant(input: GatewayScope & {
1383
+ topicId: string;
1384
+ permission: PermissionKind;
1385
+ principal?: string;
1386
+ principalId?: string;
1387
+ groupId?: string;
1388
+ beliefClusterId?: string;
1389
+ expiresAt?: number;
1390
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1391
+ revoke(input: GatewayScope & {
1392
+ topicId: string;
1393
+ principal?: string;
1394
+ principalId?: string;
1395
+ groupId?: string;
1396
+ beliefClusterId?: string;
1397
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1398
+ listWritePolicies(query?: GatewayScope & {
1399
+ topicId?: string;
1400
+ role?: string;
1401
+ toolCategory?: string;
1402
+ enabled?: boolean;
1403
+ }): Promise<{
1404
+ data: {
1405
+ policies: WritePolicyRecord[];
1406
+ };
1407
+ success: true;
1408
+ correlationId: string;
1409
+ policyTraceId: string | null;
1410
+ idempotentReplay: boolean;
1411
+ }>;
1412
+ createWritePolicy(input: WritePolicyCreateInput, idempotencyKey?: string): Promise<{
1413
+ data: {
1414
+ id: string | undefined;
1415
+ created: boolean;
1416
+ policy: WritePolicyRecord | null;
1417
+ };
1418
+ success: true;
1419
+ correlationId: string;
1420
+ policyTraceId: string | null;
1421
+ idempotentReplay: boolean;
1422
+ }>;
1423
+ updateWritePolicy(id: string, input: WritePolicyUpdateInput, idempotencyKey?: string): Promise<{
1424
+ data: {
1425
+ id: string | undefined;
1426
+ updated: boolean;
1427
+ policy: WritePolicyRecord | null;
1428
+ };
1429
+ success: true;
1430
+ correlationId: string;
1431
+ policyTraceId: string | null;
1432
+ idempotentReplay: boolean;
1433
+ }>;
1434
+ deleteWritePolicy(id: string, scope?: GatewayScope, idempotencyKey?: string): Promise<PlatformGatewaySuccess<{
1435
+ id?: string;
1436
+ deleted?: boolean;
1437
+ }>>;
1438
+ listRolePolicies(query?: GatewayScope): Promise<{
1439
+ data: {
1440
+ policies: TenantPolicyRecord[];
1441
+ };
1442
+ success: true;
1443
+ correlationId: string;
1444
+ policyTraceId: string | null;
1445
+ idempotentReplay: boolean;
1446
+ }>;
1447
+ createRolePolicy(input: GatewayScope & {
1448
+ roleName: string;
1449
+ description?: string;
1450
+ permissions: TenantPolicyPermission[];
1451
+ groupBindings?: string[];
1452
+ }, idempotencyKey?: string): Promise<{
1453
+ data: {
1454
+ policy: TenantPolicyRecord | null;
1455
+ };
1456
+ success: true;
1457
+ correlationId: string;
1458
+ policyTraceId: string | null;
1459
+ idempotentReplay: boolean;
1460
+ }>;
1461
+ updateRolePolicy(id: string, input: GatewayScope & {
1462
+ roleName: string;
1463
+ description?: string;
1464
+ permissions: TenantPolicyPermission[];
1465
+ groupBindings?: string[];
1466
+ }, idempotencyKey?: string): Promise<{
1467
+ data: {
1468
+ policy: TenantPolicyRecord | null;
1469
+ };
1470
+ success: true;
1471
+ correlationId: string;
1472
+ policyTraceId: string | null;
1473
+ idempotentReplay: boolean;
1474
+ }>;
1475
+ deleteRolePolicy(id: string, scope?: GatewayScope, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1476
+ checkPermission(query: GatewayScope & {
1477
+ topicId?: string;
1478
+ permission?: PermissionKind;
1479
+ principal?: string;
1480
+ principalId?: string;
1481
+ beliefClusterId?: string;
1482
+ }): Promise<PlatformGatewaySuccess<PermissionDecision>>;
1483
+ listAccessibleTopics(query?: GatewayScope & {
1484
+ permission?: PermissionKind;
1485
+ includeShared?: boolean;
1486
+ principal?: string;
1487
+ principalId?: string;
1488
+ limit?: number;
1489
+ }): Promise<{
1490
+ data: {
1491
+ permission: PermissionKind;
1492
+ topics: {
1493
+ [key: string]: unknown;
1494
+ topicId?: string;
1495
+ name?: string;
1496
+ type?: string;
1497
+ isOwner?: boolean;
1498
+ }[];
1499
+ total: number;
1500
+ deniedTopics: {
1501
+ topicId: string;
1502
+ reasonCode: string;
1503
+ }[];
1504
+ };
1505
+ success: true;
1506
+ correlationId: string;
1507
+ policyTraceId: string | null;
1508
+ idempotentReplay: boolean;
1509
+ }>;
1510
+ filterByPermission(input: GatewayScope & {
1511
+ topicIds?: string[];
1512
+ permission?: PermissionKind;
1513
+ principal?: string;
1514
+ principalId?: string;
1515
+ }): Promise<{
1516
+ success: boolean;
1517
+ data: {
1518
+ permission: PermissionKind;
1519
+ allowedTopicIds: string[];
1520
+ deniedTopics: {
1521
+ topicId: string;
1522
+ reasonCode: string;
1523
+ }[];
1524
+ count: number;
1525
+ };
1526
+ }>;
1527
+ };
1528
+ };
1529
+ observations: {
1530
+ ingest(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1531
+ ingestObservation(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1532
+ getContext(input: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1533
+ getObservationContext(input: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1534
+ };
1535
+ coding: {
1536
+ getCodeContext(input: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1537
+ getChangeHistory(input: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1538
+ recordAttempt(input: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
1539
+ getFailureLog(input: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1540
+ };
1541
+ contracts: {
1542
+ create(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1543
+ createEpistemicContract(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1544
+ list(input?: {
1545
+ beliefNodeId?: string;
1546
+ contractId?: string;
1547
+ status?: string;
1548
+ }): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1549
+ evaluate(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1550
+ evaluateContract(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1551
+ getStatus(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1552
+ getContractStatus(input: FunctionSurfaceInput): Promise<GatewayDataEnvelope<Record<string, unknown>>>;
1553
+ };
1554
+ bootstrap: {
1555
+ generateSessionHandoff(input: FunctionSurfaceInput): FunctionSurfaceResult<unknown>;
1556
+ };
1557
+ tools: {
1558
+ register(registration: CustomToolRegistration): RegisteredCustomTool;
1559
+ unregister(fullName: string): boolean;
1560
+ list(): RegisteredCustomTool[];
1561
+ clear(): void;
1562
+ invoke(name: string, input?: CustomToolInput): Promise<unknown>;
1563
+ namespace(namespace: string): CustomToolNamespace;
1564
+ };
1565
+ packs: {
1566
+ /**
1567
+ * Ensure the configured packKey is installed.
1568
+ * No-op if no packKey was provided or if the pack is already installed.
1569
+ * Called automatically on first API use when packKey is set.
1570
+ */
1571
+ ensurePack: () => Promise<void>;
1572
+ /**
1573
+ * Check if the configured pack has been installed in this session.
1574
+ */
1575
+ readonly isInstalled: boolean;
1576
+ listCatalog(): Promise<PlatformGatewaySuccess<ListResult<any, "catalog">>>;
1577
+ catalog(): Promise<PlatformGatewaySuccess<ListResult<any, "catalog">>>;
1578
+ listStates(scope?: Parameters<(query?: GatewayScope) => Promise<PlatformGatewaySuccess<ListResult<any, "states">>>>[0]): Promise<PlatformGatewaySuccess<ListResult<any, "states">>>;
1579
+ states(scope?: Parameters<(query?: GatewayScope) => Promise<PlatformGatewaySuccess<ListResult<any, "states">>>>[0]): Promise<PlatformGatewaySuccess<ListResult<any, "states">>>;
1580
+ install(input: Parameters<(input: PackInstallInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>>[0]): Promise<PlatformGatewaySuccess<unknown>>;
1581
+ enable(input: Parameters<(input: PackEnableInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>>[0]): Promise<PlatformGatewaySuccess<unknown>>;
1582
+ disable(input: Parameters<(input: PackDisableInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>>[0]): Promise<PlatformGatewaySuccess<unknown>>;
1583
+ };
1584
+ nodes: {
1585
+ list(query: Parameters<(query: ListNodesInput) => Promise<PlatformGatewaySuccess<ListResult<PlatformGraphNode, "nodes">>>>[0]): Promise<PlatformGatewaySuccess<ListResult<PlatformGraphNode, "nodes">>>;
1586
+ get(input: string | Parameters<(query: GetNodeInput) => Promise<PlatformGatewaySuccess<PlatformGraphNode>>>[0]): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
1587
+ create(input: Parameters<(input: CreateNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PlatformGraphNode>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
1588
+ update(input: Parameters<(input: UpdateNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<PlatformGraphNode>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
1589
+ batchCreate(input: Parameters<(input: BatchCreateNodesInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1590
+ supersede(input: Parameters<(input: SupersedeNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1591
+ verify(input: Parameters<(input: VerifyNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1592
+ hardDelete(input: Parameters<(input: HardDeleteNodeInput, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<Record<string, unknown>>>>[0], idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1593
+ };
1594
+ identity: {
1595
+ whoami(): Promise<PlatformGatewaySuccess<{
1596
+ principalId: string;
1597
+ principalType: "user" | "human" | "service" | "group" | "external_viewer" | "agent";
1598
+ tenantId: string | null;
1599
+ workspaceId: string | null;
1600
+ scopes: string[];
1601
+ roles: string[];
1602
+ isPlatformAdmin: boolean;
1603
+ isTenantAdmin: boolean;
1604
+ isWorkspaceAdmin: boolean;
1605
+ authMode: string | undefined;
1606
+ sessionId: string | undefined;
1607
+ delegatedBy: string | undefined;
1608
+ expiresAt: number | undefined;
1609
+ }> & {
1610
+ principalId: string;
1611
+ principalType: "user" | "human" | "service" | "group" | "external_viewer" | "agent";
1612
+ tenantId: string | null;
1613
+ workspaceId: string | null;
1614
+ scopes: string[];
1615
+ roles: string[];
1616
+ isPlatformAdmin: boolean;
1617
+ isTenantAdmin: boolean;
1618
+ isWorkspaceAdmin: boolean;
1619
+ authMode: string | undefined;
1620
+ sessionId: string | undefined;
1621
+ delegatedBy: string | undefined;
1622
+ expiresAt: number | undefined;
1623
+ }>;
1624
+ };
1625
+ custom: CustomToolNamespace;
1626
+ extensions: Record<string, CustomToolNamespace>;
1627
+ raw: {
1628
+ beliefs: {
1629
+ createBelief(input: CreateBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformBeliefRecord>>;
1630
+ refineBelief(beliefId: string, input: RefineBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformBeliefRecord>>;
1631
+ modulateConfidence: {
1632
+ (beliefId: string, input: ModulateConfidenceOpinionInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<ModulateConfidenceResponse>>;
1633
+ (beliefId: string, input: ModulateConfidenceScalarInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<ModulateConfidenceResponse>>;
1634
+ };
1635
+ getOpinionHistory(beliefId: string): Promise<OpinionHistoryEntry[]>;
1636
+ getConfidenceHistory(beliefId: string): Promise<OpinionHistoryEntry[]>;
1637
+ forkBelief(beliefId: string, input: ForkBeliefInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<ForkBeliefResponse>>;
1638
+ updateBeliefStatus(input: UpdateBeliefStatusInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1639
+ updateBeliefRationale(input: UpdateBeliefRationaleInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1640
+ linkBeliefs(input: LinkBeliefsInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1641
+ unlinkBeliefEvidence(input: UnlinkBeliefEvidenceInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1642
+ updateBeliefCriticality(input: UpdateBeliefCriticalityInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1643
+ batchUpdateBeliefCriticality(input: BatchUpdateBeliefCriticalityInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1644
+ reassignBeliefsTopic(input: ReassignBeliefsTopicInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1645
+ };
1646
+ sources: {
1647
+ upsert(spec: UpsertSourceSpec, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformSourceRecord>>;
1648
+ get(sourceId: string): Promise<PlatformGatewaySuccess<PlatformSourceRecord>>;
1649
+ };
1650
+ evidence: {
1651
+ classifyEvidence(beliefId: string, evidenceId: string, classificationConfig?: EvidenceClassificationRequestConfig, idempotencyKey?: string): Promise<PlatformGatewaySuccess<ClassifyEvidenceResult>>;
1652
+ classifyEvidenceBatch(beliefId: string, evidence: ClassifyEvidenceBatchItem[], classificationConfig?: EvidenceClassificationRequestConfig, idempotencyKey?: string): Promise<PlatformGatewaySuccess<ClassifyEvidenceBatchResult>>;
1653
+ };
1654
+ graph: {
1655
+ listNodes(query: ListNodesInput): Promise<PlatformGatewaySuccess<ListResult<PlatformGraphNode, "nodes">>>;
1656
+ queryNodes(query: QueryNodesInput): Promise<PlatformGatewaySuccess<ListResult<PlatformGraphNode, "nodes">>>;
1657
+ getNode(query: GetNodeInput): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
1658
+ createNode(input: CreateNodeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
1659
+ updateNode(input: UpdateNodeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformGraphNode>>;
1660
+ batchCreateNodes(input: BatchCreateNodesInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1661
+ supersedeNode(input: SupersedeNodeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1662
+ verifyNode(input: VerifyNodeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1663
+ hardDeleteNode(input: HardDeleteNodeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1664
+ listEdges(query: ListEdgesInput): Promise<PlatformGatewaySuccess<ListResult<PlatformGraphEdge, "edges">>>;
1665
+ queryEdges(query: QueryEdgesInput): Promise<PlatformGatewaySuccess<ListResult<PlatformGraphEdge, "edges">>>;
1666
+ createEdge(input: CreateEdgeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PlatformGraphEdge>>;
1667
+ deleteEdge(query: DeleteEdgeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<DeleteEdgeResponse>>;
1668
+ neighborhood(query: NeighborhoodInput): Promise<PlatformGatewaySuccess<GraphNeighborhoodResponse>>;
1669
+ traverse(query: TraverseInput): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1670
+ analyze(query?: AnalyzeInput): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1671
+ bias(query?: BiasInput): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1672
+ gaps(query: GapsInput): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1673
+ search(query: SearchInput): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1674
+ getNeighborhood(query: NeighborhoodInput): Promise<PlatformGatewaySuccess<GraphNeighborhoodResponse>>;
1675
+ getPath(query: PathInput): Promise<PlatformGatewaySuccess<GraphPathResponse>>;
1676
+ getAnalytics(query?: AnalyticsInput): Promise<PlatformGatewaySuccess<GraphAnalyticsResponse>>;
1677
+ };
1678
+ decisions: {
1679
+ listJudgments(query: ListJudgmentsInput): Promise<PlatformGatewaySuccess<ListJudgmentsResponse>>;
1680
+ getJudgment(judgmentId: string): Promise<PlatformGatewaySuccess<GetJudgmentResponse>>;
1681
+ getJudgmentReadiness(query: {
1682
+ topicId?: string;
1683
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<JudgmentReadinessResponse>>;
1684
+ getJudgmentCalibration(query: GetJudgmentCalibrationInput): Promise<PlatformGatewaySuccess<JudgmentCalibrationResponse>>;
1685
+ listPendingOutcomeReviews(query: ListPendingJudgmentOutcomeReviewInput): Promise<PlatformGatewaySuccess<ListResult<PendingJudgmentOutcomeRecord, "reviews">>>;
1686
+ listPendingJudgmentOutcomeReview(query: ListPendingJudgmentOutcomeReviewInput): Promise<PlatformGatewaySuccess<ListResult<PendingJudgmentOutcomeRecord, "reviews">>>;
1687
+ getJudgmentTransitionAuditIntegrity(query: GetJudgmentTransitionAuditIntegrityInput): Promise<PlatformGatewaySuccess<JudgmentTransitionAuditIntegrityResponse>>;
1688
+ createJudgment(input: RecordJudgmentInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<RecordJudgmentResponse>>;
1689
+ recordJudgment(input: RecordJudgmentInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<RecordJudgmentResponse>>;
1690
+ updateJudgmentOutcome(judgmentId: string, input: RecordJudgmentOutcomeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<RecordJudgmentOutcomeResponse>>;
1691
+ recordJudgmentOutcome(judgmentId: string, input: RecordJudgmentOutcomeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<RecordJudgmentOutcomeResponse>>;
1692
+ };
1693
+ workflow: {
1694
+ listBranches(query: {
1695
+ topicId?: string;
1696
+ status?: WorkflowBranchStatus;
1697
+ limit?: number;
1698
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<ListResult<WorkflowBranchRecord, "branches">>>;
1699
+ createBranch(input: {
1700
+ name: string;
1701
+ topicId?: string;
1702
+ description?: string;
1703
+ metadata?: JsonObject;
1704
+ } & TopicIdentifierInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowBranchRecord>>;
1705
+ listLenses(query: {
1706
+ workspaceId?: string;
1707
+ topicId?: string;
1708
+ status?: WorkflowLensStatus;
1709
+ perspectiveType?: WorkflowLensPerspectiveType;
1710
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<ListResult<WorkflowLensRecord, "lenses">>>;
1711
+ createLens(input: {
1712
+ name: string;
1713
+ workspaceId?: string;
1714
+ topicId?: string;
1715
+ description?: string;
1716
+ perspectiveType: WorkflowLensPerspectiveType;
1717
+ promptTemplates?: LensPromptTemplateReference[];
1718
+ workflowTemplates?: LensWorkflowTemplate[];
1719
+ taskTemplates?: LensTaskTemplate[];
1720
+ filterCriteria?: JsonObject;
1721
+ } & TopicIdentifierInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowLensRecord>>;
1722
+ applyLensToTopic(input: {
1723
+ lensId: string;
1724
+ topicId?: string;
1725
+ metadata?: JsonObject;
1726
+ } & TopicIdentifierInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowLensBindingRecord>>;
1727
+ removeLensFromTopic(input: {
1728
+ lensId: string;
1729
+ topicId?: string;
1730
+ } & TopicIdentifierInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowLensBindingRecord>>;
1731
+ listWorktrees(query: {
1732
+ topicId?: string;
1733
+ branchId?: string;
1734
+ status?: WorkflowWorktreeStatus;
1735
+ track?: string;
1736
+ executionBand?: number;
1737
+ limit?: number;
1738
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<ListResult<WorkflowWorktreeRecord, "worktrees">>>;
1739
+ listAllWorktrees(query?: {
1740
+ status?: WorkflowWorktreeStatus;
1741
+ track?: string;
1742
+ executionBand?: number;
1743
+ limit?: number;
1744
+ }): Promise<PlatformGatewaySuccess<ListWorktreesResponse>>;
1745
+ createWorktree(input: AddWorktreeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowWorktreeRecord>>;
1746
+ addWorktree(input: AddWorktreeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowWorktreeRecord>>;
1747
+ merge(worktreeId: string, input: MergeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<MergeWorktreeResponse>>;
1748
+ activateWorktree(worktreeId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowWorktreeRecord>>;
1749
+ updateWorktreeTargets(input: UpdateWorktreeTargetsInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowWorktreeRecord>>;
1750
+ completeWorktree(input: CompleteWorktreeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1751
+ advanceWorktreePhase(input: AdvanceWorktreePhaseInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1752
+ setWorktreePhase(input: SetWorktreePhaseInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1753
+ patchWorktreeState(input: PatchWorktreeStateInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1754
+ bulkCreateWorktrees(input: BulkCreateWorktreesInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
1755
+ openPullRequest(worktreeId: string, input: {
1756
+ summary: string;
1757
+ reviewers?: string[];
1758
+ status?: "pending_review" | "changes_requested" | "approved" | "blocked";
1759
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<OpenPullRequestResponse>>;
1760
+ push(worktreeId: string, input: {
1761
+ targetContext: string;
1762
+ beliefIds?: string[];
1763
+ metadata?: JsonObject;
1764
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PushWorktreeResponse>>;
1765
+ listTopics(query?: ListTopicsInput): Promise<PlatformGatewaySuccess<ListTopicsResponse>>;
1766
+ switchTopicContext(input: SwitchTopicContextInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<SwitchTopicContextResponse>>;
1767
+ createTask(input: CreateTaskInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<CreateTaskResponse>>;
1768
+ completeTask(taskId: string, input: CompleteTaskInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<CompleteTaskResponse>>;
1769
+ updateTask(taskId: string, input: UpdateTaskInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<UpdateTaskResponse>>;
1770
+ createPillar(input: {
1771
+ name: string;
1772
+ topicId?: string;
1773
+ description?: string;
1774
+ metadata?: JsonObject;
1775
+ } & TopicIdentifierInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowBranchRecord>>;
1776
+ createSprint(input: {
1777
+ title: string;
1778
+ topicId?: string;
1779
+ branchId?: string;
1780
+ hypothesis?: string;
1781
+ beliefIds?: string[];
1782
+ } & TopicIdentifierInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<WorkflowWorktreeRecord>>;
1783
+ completeSprint(worktreeId: string, input: MergeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<MergeWorktreeResponse>>;
1784
+ requestReview(worktreeId: string, input: {
1785
+ summary: string;
1786
+ reviewers?: string[];
1787
+ status?: "pending_review" | "changes_requested" | "approved" | "blocked";
1788
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<OpenPullRequestResponse>>;
1789
+ publishFindings(worktreeId: string, input: {
1790
+ targetContext: string;
1791
+ beliefIds?: string[];
1792
+ metadata?: JsonObject;
1793
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<PushWorktreeResponse>>;
1794
+ };
1795
+ audit: {
1796
+ listEvents(query?: GatewayScope & {
1797
+ action?: string;
1798
+ decision?: string;
1799
+ traceId?: string;
1800
+ principalId?: string;
1801
+ topicId?: string;
1802
+ limit?: number;
1803
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<ListResult<any, "events">>>;
1804
+ };
1805
+ admin: {
1806
+ listTenants(query?: {
1807
+ status?: "provisioning" | "active" | "disabled" | "suspended" | "archived";
1808
+ limit?: number;
1809
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "tenants">>>;
1810
+ createTenant(input: {
1811
+ key: string;
1812
+ slug?: string;
1813
+ name: string;
1814
+ tier?: "free" | "developer" | "team" | "enterprise";
1815
+ status?: "provisioning" | "active" | "disabled" | "suspended" | "archived";
1816
+ ownerClerkId?: string;
1817
+ ownerEmail?: string;
1818
+ lucernDeploymentUrl?: string;
1819
+ appDeploymentUrl?: string;
1820
+ metadata?: JsonObject;
1821
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1822
+ getControlObjectOwnership(): Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
1823
+ getControlObjectOwnershipContract(): Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
1824
+ listWorkspaces(query?: GatewayScope & {
1825
+ status?: "active" | "archived";
1826
+ limit?: number;
1827
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "workspaces">>>;
1828
+ createWorkspace(input: GatewayScope & {
1829
+ workspaceId?: string;
1830
+ key?: string;
1831
+ slug?: string;
1832
+ name?: string;
1833
+ status?: "active" | "archived";
1834
+ defaultProjectVisibility?: "private" | "team" | "firm" | "external" | "public";
1835
+ restore?: boolean;
1836
+ metadata?: JsonObject;
1837
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1838
+ listMemberships(query?: GatewayScope & {
1839
+ principalId?: string;
1840
+ status?: "active" | "invited" | "revoked" | "expired";
1841
+ role?: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
1842
+ limit?: number;
1843
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "memberships">>>;
1844
+ createMembership(input: GatewayScope & {
1845
+ membershipId?: string;
1846
+ principalId: string;
1847
+ role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
1848
+ status?: "active" | "invited" | "revoked" | "expired";
1849
+ source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
1850
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1851
+ updateMembership(input: GatewayScope & {
1852
+ membershipId?: string;
1853
+ principalId: string;
1854
+ role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
1855
+ status?: "active" | "invited" | "revoked" | "expired";
1856
+ source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
1857
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1858
+ upsertMembership(input: GatewayScope & {
1859
+ membershipId?: string;
1860
+ principalId: string;
1861
+ role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
1862
+ status?: "active" | "invited" | "revoked" | "expired";
1863
+ source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
1864
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1865
+ listTenantApiKeys(scope: GatewayScope & {
1866
+ status?: "active" | "revoked" | "expired";
1867
+ }): Promise<{
1868
+ data: {
1869
+ keys: TenantApiKeyRecord[];
1870
+ };
1871
+ success: true;
1872
+ correlationId: string;
1873
+ policyTraceId: string | null;
1874
+ idempotentReplay: boolean;
1875
+ }>;
1876
+ createTenantApiKey(input: GatewayScope & {
1877
+ label?: string;
1878
+ scopes: string[];
1879
+ expiresAt?: number;
1880
+ }, idempotencyKey?: string): Promise<{
1881
+ data: {
1882
+ key: TenantApiKeyRecord | null;
1883
+ plaintextKey: string | undefined;
1884
+ };
1885
+ success: true;
1886
+ correlationId: string;
1887
+ policyTraceId: string | null;
1888
+ idempotentReplay: boolean;
1889
+ }>;
1890
+ revokeTenantApiKey(keyId: string, input?: GatewayScope & {
1891
+ reason?: string;
1892
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1893
+ listTenantVaultSecrets(scope: GatewayScope): Promise<{
1894
+ data: {
1895
+ secrets: TenantVaultSecretRecord[];
1896
+ };
1897
+ success: true;
1898
+ correlationId: string;
1899
+ policyTraceId: string | null;
1900
+ idempotentReplay: boolean;
1901
+ }>;
1902
+ createTenantVaultSecret(input: GatewayScope & {
1903
+ name: string;
1904
+ description?: string;
1905
+ value: string;
1906
+ }, idempotencyKey?: string): Promise<{
1907
+ data: {
1908
+ secret: TenantVaultSecretRecord | null;
1909
+ };
1910
+ success: true;
1911
+ correlationId: string;
1912
+ policyTraceId: string | null;
1913
+ idempotentReplay: boolean;
1914
+ }>;
1915
+ updateTenantVaultSecret(secretId: string, input: GatewayScope & {
1916
+ name: string;
1917
+ description?: string;
1918
+ value?: string;
1919
+ }, idempotencyKey?: string): Promise<{
1920
+ data: {
1921
+ secret: TenantVaultSecretRecord | null;
1922
+ };
1923
+ success: true;
1924
+ correlationId: string;
1925
+ policyTraceId: string | null;
1926
+ idempotentReplay: boolean;
1927
+ }>;
1928
+ deleteTenantVaultSecret(secretId: string, scope: GatewayScope, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1929
+ listTenantSecrets(scope: GatewayScope & {
1930
+ providerId?: string;
1931
+ status?: "active" | "revoked";
1932
+ }): Promise<PlatformGatewaySuccess<unknown>>;
1933
+ upsertTenantSecret(input: GatewayScope & {
1934
+ providerId: string;
1935
+ apiKey: string;
1936
+ label?: string;
1937
+ modelSlotIds?: string[];
1938
+ passThroughOnly?: boolean;
1939
+ metadata?: JsonObject;
1940
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1941
+ revokeTenantSecret(secretRef: string, input: GatewayScope & {
1942
+ reason?: string;
1943
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1944
+ getTenantConfig(scope: GatewayScope & {
1945
+ tenantId: string;
1946
+ }): Promise<PlatformGatewaySuccess<TenantConfigRecord>>;
1947
+ getTenantModelRouting(scope: GatewayScope & {
1948
+ tenantId: string;
1949
+ }): Promise<PlatformGatewaySuccess<TenantModelRoutingSnapshot>>;
1950
+ upsertTenantConfig(input: GatewayScope & Omit<TenantConfigRecord, "updatedAt" | "updatedBy">, idempotencyKey?: string): Promise<PlatformGatewaySuccess<TenantConfigRecord>>;
1951
+ listGroups(scope?: GatewayScope & {
1952
+ limit?: number;
1953
+ }): Promise<PlatformGatewaySuccess<unknown>>;
1954
+ createGroup(input: GatewayScope & {
1955
+ name: string;
1956
+ groupKey?: string;
1957
+ groupType?: string;
1958
+ description?: string;
1959
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1960
+ updateGroup(groupId: string, input: GatewayScope & {
1961
+ name?: string;
1962
+ description?: string;
1963
+ workspaceId?: string;
1964
+ clearWorkspaceId?: boolean;
1965
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1966
+ deleteGroup(groupId: string, input?: GatewayScope, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1967
+ listGroupMembers(query: GatewayScope & {
1968
+ groupId: string;
1969
+ }): Promise<PlatformGatewaySuccess<unknown>>;
1970
+ addGroupMember(input: GatewayScope & {
1971
+ groupId: string;
1972
+ principalId: string;
1973
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1974
+ removeGroupMember(input: GatewayScope & {
1975
+ groupId: string;
1976
+ principalId: string;
1977
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1978
+ listPackGroupAssignments(query?: GatewayScope & {
1979
+ groupId?: string;
1980
+ status?: string;
1981
+ }): Promise<PlatformGatewaySuccess<unknown>>;
1982
+ assignPackToGroup(input: GatewayScope & {
1983
+ groupId: string;
1984
+ packKey: string;
1985
+ packVersion?: string;
1986
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1987
+ removePackFromGroup(input: GatewayScope & {
1988
+ groupId: string;
1989
+ packKey: string;
1990
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
1991
+ };
1992
+ identity: {
1993
+ whoami(): Promise<PlatformGatewaySuccess<{
1994
+ principalId: string;
1995
+ principalType: "user" | "human" | "service" | "group" | "external_viewer" | "agent";
1996
+ tenantId: string | null;
1997
+ workspaceId: string | null;
1998
+ scopes: string[];
1999
+ roles: string[];
2000
+ isPlatformAdmin: boolean;
2001
+ isTenantAdmin: boolean;
2002
+ isWorkspaceAdmin: boolean;
2003
+ authMode: string | undefined;
2004
+ sessionId: string | undefined;
2005
+ delegatedBy: string | undefined;
2006
+ expiresAt: number | undefined;
2007
+ }>>;
2008
+ listPrincipals(query?: GatewayScope & {
2009
+ status?: string;
2010
+ principalType?: string;
2011
+ query?: string;
2012
+ limit?: number;
2013
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "principals">>>;
2014
+ createPrincipal(input: GatewayScope & {
2015
+ principalId: string;
2016
+ principalType: "user" | "group" | "service" | "external_viewer";
2017
+ clerkId?: string;
2018
+ email?: string;
2019
+ displayName?: string;
2020
+ status?: "active" | "invited" | "suspended" | "disabled" | "revoked";
2021
+ metadata?: JsonObject;
2022
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2023
+ updatePrincipal(input: GatewayScope & {
2024
+ principalId: string;
2025
+ principalType: "user" | "group" | "service" | "external_viewer";
2026
+ clerkId?: string;
2027
+ email?: string;
2028
+ displayName?: string;
2029
+ status?: "active" | "invited" | "suspended" | "disabled" | "revoked";
2030
+ metadata?: JsonObject;
2031
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2032
+ upsertPrincipal(input: GatewayScope & {
2033
+ principalId: string;
2034
+ principalType: "user" | "group" | "service" | "external_viewer";
2035
+ clerkId?: string;
2036
+ email?: string;
2037
+ displayName?: string;
2038
+ status?: "active" | "invited" | "suspended" | "disabled" | "revoked";
2039
+ metadata?: JsonObject;
2040
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2041
+ listKeys(query?: GatewayScope & {
2042
+ principalId?: string;
2043
+ status?: string;
2044
+ limit?: number;
2045
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "keys">>>;
2046
+ createKey(input: GatewayScope & {
2047
+ principalId: string;
2048
+ keyId?: string;
2049
+ token?: string;
2050
+ scopes?: string[];
2051
+ environment?: "sandbox" | "production";
2052
+ expiresInDays?: number;
2053
+ rateLimitTier?: "free" | "developer" | "partner";
2054
+ metadata?: JsonObject;
2055
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2056
+ rotateKey(keyId: string, input?: {
2057
+ replacementKeyId?: string;
2058
+ replacementToken?: string;
2059
+ replacementExpiresInDays?: number;
2060
+ gracePeriodHours?: number;
2061
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2062
+ deleteKey(keyId: string, input?: {
2063
+ reason?: string;
2064
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2065
+ revokeKey(keyId: string, input?: {
2066
+ reason?: string;
2067
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2068
+ searchClerkUsers(q: string): Promise<PlatformGatewaySuccess<ClerkUserSearchResult[]>>;
2069
+ };
2070
+ policy: {
2071
+ listDecisions(query?: GatewayScope & {
2072
+ action?: string;
2073
+ decision?: string;
2074
+ traceId?: string;
2075
+ principalId?: string;
2076
+ topicId?: string;
2077
+ limit?: number;
2078
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "decisions">>>;
2079
+ grant(input: GatewayScope & {
2080
+ topicId: string;
2081
+ permission: PermissionKind;
2082
+ principal?: string;
2083
+ principalId?: string;
2084
+ groupId?: string;
2085
+ beliefClusterId?: string;
2086
+ expiresAt?: number;
2087
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2088
+ revoke(input: GatewayScope & {
2089
+ topicId: string;
2090
+ principal?: string;
2091
+ principalId?: string;
2092
+ groupId?: string;
2093
+ beliefClusterId?: string;
2094
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2095
+ listWritePolicies(query?: GatewayScope & {
2096
+ topicId?: string;
2097
+ role?: string;
2098
+ toolCategory?: string;
2099
+ enabled?: boolean;
2100
+ }): Promise<{
2101
+ data: {
2102
+ policies: WritePolicyRecord[];
2103
+ };
2104
+ success: true;
2105
+ correlationId: string;
2106
+ policyTraceId: string | null;
2107
+ idempotentReplay: boolean;
2108
+ }>;
2109
+ createWritePolicy(input: WritePolicyCreateInput, idempotencyKey?: string): Promise<{
2110
+ data: {
2111
+ id: string | undefined;
2112
+ created: boolean;
2113
+ policy: WritePolicyRecord | null;
2114
+ };
2115
+ success: true;
2116
+ correlationId: string;
2117
+ policyTraceId: string | null;
2118
+ idempotentReplay: boolean;
2119
+ }>;
2120
+ updateWritePolicy(id: string, input: WritePolicyUpdateInput, idempotencyKey?: string): Promise<{
2121
+ data: {
2122
+ id: string | undefined;
2123
+ updated: boolean;
2124
+ policy: WritePolicyRecord | null;
2125
+ };
2126
+ success: true;
2127
+ correlationId: string;
2128
+ policyTraceId: string | null;
2129
+ idempotentReplay: boolean;
2130
+ }>;
2131
+ deleteWritePolicy(id: string, scope?: GatewayScope, idempotencyKey?: string): Promise<PlatformGatewaySuccess<{
2132
+ id?: string;
2133
+ deleted?: boolean;
2134
+ }>>;
2135
+ listRolePolicies(query?: GatewayScope): Promise<{
2136
+ data: {
2137
+ policies: TenantPolicyRecord[];
2138
+ };
2139
+ success: true;
2140
+ correlationId: string;
2141
+ policyTraceId: string | null;
2142
+ idempotentReplay: boolean;
2143
+ }>;
2144
+ createRolePolicy(input: GatewayScope & {
2145
+ roleName: string;
2146
+ description?: string;
2147
+ permissions: TenantPolicyPermission[];
2148
+ groupBindings?: string[];
2149
+ }, idempotencyKey?: string): Promise<{
2150
+ data: {
2151
+ policy: TenantPolicyRecord | null;
2152
+ };
2153
+ success: true;
2154
+ correlationId: string;
2155
+ policyTraceId: string | null;
2156
+ idempotentReplay: boolean;
2157
+ }>;
2158
+ updateRolePolicy(id: string, input: GatewayScope & {
2159
+ roleName: string;
2160
+ description?: string;
2161
+ permissions: TenantPolicyPermission[];
2162
+ groupBindings?: string[];
2163
+ }, idempotencyKey?: string): Promise<{
2164
+ data: {
2165
+ policy: TenantPolicyRecord | null;
2166
+ };
2167
+ success: true;
2168
+ correlationId: string;
2169
+ policyTraceId: string | null;
2170
+ idempotentReplay: boolean;
2171
+ }>;
2172
+ deleteRolePolicy(id: string, scope?: GatewayScope, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2173
+ checkPermission(query: GatewayScope & {
2174
+ topicId?: string;
2175
+ permission?: PermissionKind;
2176
+ principal?: string;
2177
+ principalId?: string;
2178
+ beliefClusterId?: string;
2179
+ }): Promise<PlatformGatewaySuccess<PermissionDecision>>;
2180
+ listAccessibleTopics(query?: GatewayScope & {
2181
+ permission?: PermissionKind;
2182
+ includeShared?: boolean;
2183
+ principal?: string;
2184
+ principalId?: string;
2185
+ limit?: number;
2186
+ }): Promise<{
2187
+ data: {
2188
+ permission: PermissionKind;
2189
+ topics: {
2190
+ [key: string]: unknown;
2191
+ topicId?: string;
2192
+ name?: string;
2193
+ type?: string;
2194
+ isOwner?: boolean;
2195
+ }[];
2196
+ total: number;
2197
+ deniedTopics: {
2198
+ topicId: string;
2199
+ reasonCode: string;
2200
+ }[];
2201
+ };
2202
+ success: true;
2203
+ correlationId: string;
2204
+ policyTraceId: string | null;
2205
+ idempotentReplay: boolean;
2206
+ }>;
2207
+ filterByPermission(input: GatewayScope & {
2208
+ topicIds?: string[];
2209
+ permission?: PermissionKind;
2210
+ principal?: string;
2211
+ principalId?: string;
2212
+ }): Promise<{
2213
+ success: boolean;
2214
+ data: {
2215
+ permission: PermissionKind;
2216
+ allowedTopicIds: string[];
2217
+ deniedTopics: {
2218
+ topicId: string;
2219
+ reasonCode: string;
2220
+ }[];
2221
+ count: number;
2222
+ };
2223
+ }>;
2224
+ };
2225
+ answers: {
2226
+ get(questionId: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
2227
+ };
2228
+ ontology: {
2229
+ list(filters?: GatewayScope & {
2230
+ tenantId?: string;
2231
+ tier?: string;
2232
+ status?: string;
2233
+ }): Promise<PlatformGatewaySuccess<{
2234
+ ontologies: any[];
2235
+ total: number;
2236
+ items: any[];
2237
+ definitions: any[];
2238
+ }>>;
2239
+ get(id: string): Promise<PlatformGatewaySuccess<unknown>>;
2240
+ bind(input: OntologyBindingInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2241
+ listDefinitions(filters?: GatewayScope & {
2242
+ tenantId?: string;
2243
+ tier?: string;
2244
+ status?: string;
2245
+ }): Promise<PlatformGatewaySuccess<{
2246
+ ontologies: any[];
2247
+ total: number;
2248
+ items: any[];
2249
+ definitions: any[];
2250
+ }>>;
2251
+ getDefinition(id: string): Promise<PlatformGatewaySuccess<unknown>>;
2252
+ createDefinition(input: OntologyDefinitionInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2253
+ updateDefinition(id: string, input: OntologyDefinitionUpdateInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2254
+ archiveDefinition(id: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2255
+ listVersions(ontologyId: string, filters?: GatewayScope & {
2256
+ status?: string;
2257
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "versions">>>;
2258
+ createVersion(ontologyId: string, input: OntologyVersionInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2259
+ publishVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2260
+ deprecateVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2261
+ listTopics(ontologyId: string): Promise<PlatformGatewaySuccess<ListResult<any, "topics">>>;
2262
+ listTopicsByOntology(ontologyId: string): Promise<PlatformGatewaySuccess<ListResult<any, "topics">>>;
2263
+ };
2264
+ functionSurface: {
2265
+ sessionId: string;
2266
+ activateWorktree(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2267
+ addEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2268
+ addWorktree(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2269
+ analyzeTopicDensity(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2270
+ answerQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2271
+ applyAutoBranching(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2272
+ applyLensToTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2273
+ applyOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2274
+ archiveBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2275
+ archiveOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2276
+ archiveQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2277
+ bisectConfidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2278
+ broadcastMessage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2279
+ checkPermission(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2280
+ claimFiles(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2281
+ compileContext(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2282
+ completeTask(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2283
+ createAnswer(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2284
+ createBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2285
+ createEdge(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2286
+ createEpistemicContract(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2287
+ createEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2288
+ createLens(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2289
+ createOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2290
+ createOntologyVersion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2291
+ createQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2292
+ createTask(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2293
+ createTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2294
+ deprecateOntologyVersion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2295
+ detectConfirmationBias(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2296
+ discover(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2297
+ discoverEntityConnections(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2298
+ endSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2299
+ evaluateContract(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2300
+ filterByPermission(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2301
+ findContradictions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2302
+ findMissingQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2303
+ flagContradiction(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2304
+ forkBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2305
+ generateSessionHandoff(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2306
+ getAgentInbox(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2307
+ getAnswer(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2308
+ getAuditTrail(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2309
+ getBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2310
+ getChangeHistory(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2311
+ getCodeContext(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2312
+ getConfidenceHistory(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2313
+ getContractStatus(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2314
+ getEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2315
+ getFailureLog(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2316
+ getFalsificationQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2317
+ getGraphGaps(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2318
+ getGraphNeighborhood(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2319
+ getGraphStructureAnalysis(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2320
+ getHighPriorityQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2321
+ getLatticeCoverage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2322
+ getObservationContext(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2323
+ getOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2324
+ getQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2325
+ getTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2326
+ getTopicCoverage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2327
+ getTopicTree(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2328
+ heartbeatSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2329
+ whoami(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2330
+ ingestObservation(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2331
+ linkEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2332
+ linkEvidenceToBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2333
+ linkEvidenceToQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2334
+ listActiveSessions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2335
+ listAllWorktrees(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2336
+ listBeliefs(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2337
+ listEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2338
+ listLenses(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2339
+ listOntologies(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2340
+ listQuestions(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2341
+ listTasks(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2342
+ listTopics(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2343
+ listWorktrees(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2344
+ manageWritePolicy(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2345
+ matchEntityType(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2346
+ merge(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2347
+ modulateConfidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2348
+ openPullRequest(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2349
+ pipelineSnapshot(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2350
+ publishOntologyVersion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2351
+ push(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2352
+ queryLineage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2353
+ recordAttempt(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2354
+ recordJudgment(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2355
+ recordScopeLearning(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2356
+ refineBelief(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2357
+ refineQuestion(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2358
+ registerSession(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2359
+ removeLensFromTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2360
+ resolveEffectiveOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2361
+ searchBeliefs(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2362
+ searchEvidence(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2363
+ seedBeliefLattice(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2364
+ sendAgentMessage(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2365
+ traceEntityImpact(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2366
+ traverseGraph(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2367
+ triggerBeliefReview(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2368
+ updateOntology(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2369
+ updateQuestionStatus(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2370
+ updateTask(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2371
+ updateTopic(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2372
+ updateWorktreeMetadata(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2373
+ updateWorktreeTargets(input?: FunctionSurfaceInput, idempotencyKey?: string): FunctionSurfaceResult<unknown>;
2374
+ };
2375
+ packs: {
2376
+ listCatalog(): Promise<PlatformGatewaySuccess<ListResult<any, "catalog">>>;
2377
+ getCatalog(): Promise<PlatformGatewaySuccess<ListResult<any, "catalog">>>;
2378
+ getDiscoveryCatalog(): Promise<PlatformGatewaySuccess<unknown>>;
2379
+ getDiscoveryDetail(packKey: string): Promise<PlatformGatewaySuccess<unknown>>;
2380
+ listStates(query?: GatewayScope): Promise<PlatformGatewaySuccess<ListResult<any, "states">>>;
2381
+ getStates(query?: GatewayScope): Promise<PlatformGatewaySuccess<ListResult<any, "states">>>;
2382
+ getHealth(packKey: string, query?: GatewayScope): Promise<PlatformGatewaySuccess<unknown>>;
2383
+ listTelemetry(query?: GatewayScope & {
2384
+ lookbackHours?: number;
2385
+ limit?: number;
2386
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "telemetry">>>;
2387
+ getTelemetry(query?: GatewayScope & {
2388
+ lookbackHours?: number;
2389
+ limit?: number;
2390
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "telemetry">>>;
2391
+ createEntitlement(input: PackEntitlementInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2392
+ updateEntitlement(input: PackEntitlementInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2393
+ upsertEntitlement(input: PackEntitlementInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2394
+ install(input: PackInstallInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2395
+ enable(input: PackEnableInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2396
+ disable(input: PackDisableInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2397
+ uninstall(input: PackUninstallInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2398
+ upgrade(input: PackUpgradeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2399
+ };
2400
+ reports: {
2401
+ listTemplates(args?: {
2402
+ slug?: string;
2403
+ }): Promise<PlatformGatewaySuccess<ReportTemplatesResponse>>;
2404
+ getTemplates(args?: {
2405
+ slug?: string;
2406
+ }): Promise<PlatformGatewaySuccess<ReportTemplatesResponse>>;
2407
+ listReports(input: TopicIdentifierInput, args?: {
2408
+ summary?: boolean;
2409
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "reports">>>;
2410
+ getReport(reportId: string): Promise<PlatformGatewaySuccess<ReportWithSectionsResponse>>;
2411
+ };
2412
+ learning: {
2413
+ listRecentExecutions(args?: {
2414
+ namespace?: string;
2415
+ topicId?: string;
2416
+ audienceMode?: string;
2417
+ success?: boolean;
2418
+ limit?: number;
2419
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<ListResult<any, "executions">>>;
2420
+ getRecentExecutions(args?: {
2421
+ namespace?: string;
2422
+ topicId?: string;
2423
+ audienceMode?: string;
2424
+ success?: boolean;
2425
+ limit?: number;
2426
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<ListResult<any, "executions">>>;
2427
+ getExecutionStats(args?: {
2428
+ namespace?: string;
2429
+ topicId?: string;
2430
+ audienceMode?: string;
2431
+ hours?: number;
2432
+ } & TopicIdentifierInput): Promise<PlatformGatewaySuccess<unknown>>;
2433
+ };
2434
+ harness: {
2435
+ listAgentDefinitions(scope?: GatewayScope & {
2436
+ status?: string;
2437
+ limit?: number;
2438
+ cursor?: string;
2439
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "agents">>>;
2440
+ getAgentDefinition(agentId: string, scope?: GatewayScope): Promise<PlatformGatewaySuccess<unknown>>;
2441
+ createAgentDefinition(input: HarnessAgentWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2442
+ registerAgentDefinition(input: HarnessAgentWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2443
+ updateAgentDefinition(agentId: string, input: HarnessAgentWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2444
+ invokeManagedAgentDefinition(agentId: string, input: Omit<HarnessInvokeManagedAgentInput, "agentDefinitionId">, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2445
+ listAgentRuns(agentId: string, scope?: GatewayScope & {
2446
+ status?: string;
2447
+ limit? /**
2448
+ * Optional Clerk JWT for per-user identity and RBAC.
2449
+ * When present, the SDK operates in user-scoped mode with
2450
+ * pack-aware tool filtering. When absent, operates in agent mode.
2451
+ */: number;
2452
+ cursor?: string;
2453
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "runs">>>;
2454
+ listRunsForAgent(agentId: string, scope?: GatewayScope & {
2455
+ status?: string;
2456
+ limit?: number;
2457
+ cursor?: string;
2458
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "runs">>>;
2459
+ listToolDefinitions(scope?: GatewayScope & {
2460
+ status?: string;
2461
+ limit?: number;
2462
+ cursor?: string;
2463
+ gateClassification?: string;
2464
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "tools">>>;
2465
+ getToolDefinition(toolId: string, scope?: GatewayScope): Promise<PlatformGatewaySuccess<unknown>>;
2466
+ createToolDefinition(input: HarnessToolWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2467
+ registerToolDefinition(input: HarnessToolWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2468
+ updateToolDefinition(toolId: string, input: HarnessToolWriteInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2469
+ executeToolDefinition(toolId: string, input?: HarnessExecuteToolInput): Promise<PlatformGatewaySuccess<HarnessExecuteToolResult>>;
2470
+ listRunEntries(scope?: GatewayScope & {
2471
+ status?: string;
2472
+ limit?: number;
2473
+ cursor?: string;
2474
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "runs">>>;
2475
+ listRunLedgerEntries(scope?: GatewayScope & {
2476
+ status?: string;
2477
+ limit?: number;
2478
+ cursor?: string;
2479
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "runs">>>;
2480
+ startHarnessRun(input: HarnessStartRunInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2481
+ getRunLedgerEntry(runId: string): Promise<PlatformGatewaySuccess<unknown>>;
2482
+ reportHarnessRunEvent(runId: string, input: HarnessRunReportInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2483
+ heartbeatHarnessRun(runId: string, input: {
2484
+ reportingToken: string;
2485
+ }, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2486
+ completeHarnessRun(runId: string, input: HarnessCompleteRunInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2487
+ listPromptResolutions(query?: {
2488
+ runId?: string;
2489
+ promptName?: string;
2490
+ limit?: number;
2491
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "prompts">>>;
2492
+ getScopeTaxonomy(): Promise<PlatformGatewaySuccess<unknown>>;
2493
+ };
2494
+ schema: {
2495
+ listPacks(scope?: GatewayScope): Promise<PlatformGatewaySuccess<ListResult<any, "packs">>>;
2496
+ installPack(input: SchemaPackInstallInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2497
+ getPack(packId: string, scope?: GatewayScope): Promise<PlatformGatewaySuccess<unknown>>;
2498
+ listEntitlements(scope?: GatewayScope & {
2499
+ packKey?: string;
2500
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "entitlements">>>;
2501
+ createEntitlement(input: SchemaEntitlementInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2502
+ updateEntitlement(input: SchemaEntitlementInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2503
+ upsertEntitlement(input: SchemaEntitlementInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2504
+ };
2505
+ audiences: {
2506
+ listRegistry(query?: GatewayScope & {
2507
+ effective?: boolean;
2508
+ status?: "active" | "disabled" | "archived";
2509
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "registryEntries">>>;
2510
+ getRegistry(query?: GatewayScope & {
2511
+ effective?: boolean;
2512
+ status?: "active" | "disabled" | "archived";
2513
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "registryEntries">>>;
2514
+ createRegistryEntry(input: AudienceRegistryInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2515
+ updateRegistryEntry(input: AudienceRegistryInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2516
+ upsertRegistry(input: AudienceRegistryInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2517
+ listGrants(query?: GatewayScope & {
2518
+ audienceKey?: string;
2519
+ principalId?: string;
2520
+ groupId?: string;
2521
+ status?: "active" | "revoked" | "expired";
2522
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "grants">>>;
2523
+ getGrants(query?: GatewayScope & {
2524
+ audienceKey?: string;
2525
+ principalId?: string;
2526
+ groupId?: string;
2527
+ status?: "active" | "revoked" | "expired";
2528
+ }): Promise<PlatformGatewaySuccess<ListResult<any, "grants">>>;
2529
+ createGrant(input: AudienceGrantInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2530
+ grant(input: AudienceGrantInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2531
+ deleteGrant(input: AudienceGrantRevokeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2532
+ revokeGrant(input: AudienceGrantRevokeInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
2533
+ };
2534
+ topics: {
2535
+ list(query?: TopicListInput): Promise<PlatformGatewaySuccess<TopicListResponse>>;
2536
+ get(topicId: string): Promise<PlatformGatewaySuccess<TopicRecord>>;
2537
+ create(input: TopicCreateInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<TopicRecord>>;
2538
+ update(topicId: string, input: TopicUpdateInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<TopicRecord>>;
2539
+ getTree(topicId: string, query?: TopicTreeQuery): Promise<PlatformGatewaySuccess<TopicTreeResponse>>;
2540
+ getCoverage(topicId: string, query?: TopicCoverageQuery): Promise<PlatformGatewaySuccess<TopicCoverageResponse>>;
2541
+ remove(topicId: string, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
2542
+ bulkCreate(input: TopicBulkCreateInput, idempotencyKey?: string): Promise<PlatformGatewaySuccess<Record<string, unknown>>>;
2543
+ };
2544
+ };
2545
+ };
2546
+
2547
+ export { type FunctionSurfaceClientConfig as F, type LucernClientConfig as L, type FunctionSurfaceInput as a, type FunctionSurfaceResult as b, createLucernClient as c, FUNCTION_SURFACE_METHOD_PATHS as d, createFunctionSurfaceClient as e };