mindgraph 0.16.0 → 0.17.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.
package/dist/index.d.mts CHANGED
@@ -779,7 +779,7 @@ interface RetrieveRequest {
779
779
  * Retrieval action. Note: `"semantic"` requires a configured embedding
780
780
  * provider on the server; for semantic search use `retrieveContext()` instead.
781
781
  */
782
- action: "text" | "semantic" | "hybrid" | "active_goals" | "open_questions" | "weak_claims" | "pending_approvals" | "unresolved_contradictions" | "stale_derivations" | "preferences" | "layer" | "recent";
782
+ action: "text" | "semantic" | "hybrid" | "active_goals" | "open_questions" | "weak_claims" | "pending_approvals" | "unresolved_contradictions" | "merge_candidates" | "stale_derivations" | "curation_counts" | "preferences" | "layer" | "recent";
783
783
  /**
784
784
  * Required for `"text"`, `"semantic"`, `"hybrid"`. Optional for
785
785
  * `"preferences"`: with a `query` you get topic-relevant preferences (the
@@ -823,6 +823,13 @@ interface RetrieveRequest {
823
823
  * provenance for citing "which teammate's notes" (D3). Requires server ≥ 1.8.0.
824
824
  */
825
825
  include_sources?: boolean;
826
+ /** Re-admit operational ledger and work-state nodes, excluded by default. */
827
+ include_ledger?: boolean;
828
+ /**
829
+ * Post-filter on how the node was created: `"document"`, `"session"` or
830
+ * `"agent"`.
831
+ */
832
+ source?: "document" | "session" | "agent";
826
833
  }
827
834
  interface TraverseRequest {
828
835
  action: "chain" | "neighborhood" | "path" | "subgraph" | "top_k_paths";
@@ -994,6 +1001,81 @@ interface RetrieveContextRequest {
994
1001
  * Windowed nodes then carry `valid_at_time` instead of `currently_valid`.
995
1002
  */
996
1003
  valid_at?: string;
1004
+ /**
1005
+ * Point-in-time perspective: answer with what had been **stated** by this
1006
+ * ISO-8601 date. A node is admitted when at least one of its source
1007
+ * documents was stated (`occurred_at`, else `publication_date`) on or
1008
+ * before the date; its own fact dates never exclude it (a plan stated in
1009
+ * June about next year is admitted). Nodes stated on both sides of the
1010
+ * date keep only their earlier sources and withhold the merged summary
1011
+ * (`spans_as_of`); undated nodes stay; closed claims stay (annotated
1012
+ * `valid_at_time: false`). Also sets the validity-annotation reference
1013
+ * when `valid_at` is absent. Wiki articles are skipped under a
1014
+ * time-scoped read. The response's `time_filter.axis` is
1015
+ * `statement_time`; use `occurred_from` / `occurred_to` for a fact-time
1016
+ * window. (Server 1.14+: before, `as_of` filtered on fact time.)
1017
+ */
1018
+ as_of?: string;
1019
+ /**
1020
+ * Inclusive occurrence window (ISO-8601, imprecision ok): only nodes and
1021
+ * chunks whose effective interval overlaps it are returned. Undated nodes
1022
+ * are excluded under a window. Either bound may be omitted.
1023
+ */
1024
+ /**
1025
+ * Evidence plan R2 (server 1.14+): `"text"` adds `context_text`,
1026
+ * `used_tokens`, `truncated` and `omitted` — the canonical rendering every
1027
+ * door shares (dated items, supersession and conflict markers, a hard
1028
+ * budget). Default `"json"`.
1029
+ */
1030
+ format?: "json" | "text";
1031
+ /** Token budget for `format: "text"` (minimum 256; default 8000). */
1032
+ max_tokens?: number;
1033
+ /** Order of `graph.nodes` in the JSON: `"rank"` (default) or `"chronological"`. */
1034
+ sort?: "rank" | "chronological";
1035
+ /**
1036
+ * `"exhaustive"` widens retrieval for list/count questions; omitted lets
1037
+ * the server's enumeration cue decide.
1038
+ */
1039
+ retrieval_mode?: "normal" | "exhaustive";
1040
+ occurred_from?: string;
1041
+ occurred_to?: string;
1042
+ /**
1043
+ * Re-admit operational ledger and work-state nodes (sessions, executions,
1044
+ * tasks, plans). Excluded from knowledge retrieval by default.
1045
+ */
1046
+ include_ledger?: boolean;
1047
+ /**
1048
+ * Bound each article's `content` to this many characters by query-aware
1049
+ * excerpting (default 6000; 0 = unlimited). The response flags `excerpted`.
1050
+ */
1051
+ article_char_limit?: number;
1052
+ /** Cosine floor for admitted articles (default 0 = off). */
1053
+ article_min_similarity?: number;
1054
+ /**
1055
+ * Attach per-leg hybrid contributions (`retrieval_legs`) to direct nodes.
1056
+ * Honored only for unscoped callers.
1057
+ */
1058
+ explain?: boolean;
1059
+ /**
1060
+ * Ontology leg control: `mode` `"auto"` (default) or `"off"`, optionally
1061
+ * restricted to one active schema. The leg runs only when the server has it
1062
+ * enabled and the org has an active schema.
1063
+ */
1064
+ ontology?: {
1065
+ mode?: "auto" | "off";
1066
+ schema_id?: string;
1067
+ };
1068
+ /**
1069
+ * What the caller is doing right now (an agent's task, the last turns of a
1070
+ * conversation), at most 2,000 characters. Read only by the question-aware
1071
+ * reranker; never used as a search term and never stored.
1072
+ */
1073
+ intent?: string;
1074
+ /**
1075
+ * Apply the question-aware rerank to graph-expansion candidates. Omitted
1076
+ * uses the server default (off).
1077
+ */
1078
+ rerank?: boolean;
997
1079
  }
998
1080
  interface ArticleResult {
999
1081
  uid: string;
@@ -1075,6 +1157,39 @@ interface SeriesContextAnnotation {
1075
1157
  };
1076
1158
  }
1077
1159
  interface RetrieveContextResponse {
1160
+ /**
1161
+ * Present only when the request set `as_of`, `occurred_from` or
1162
+ * `occurred_to`: the echoed filter plus what it excluded. World time only.
1163
+ */
1164
+ time_filter?: {
1165
+ as_of?: string;
1166
+ occurred_from?: string;
1167
+ occurred_to?: string;
1168
+ nodes_excluded: number;
1169
+ chunks_excluded: number;
1170
+ articles_excluded: boolean;
1171
+ /** `statement_time` under `as_of` (server 1.14+), `world_time` under a window. */
1172
+ axis: "world_time" | "statement_time";
1173
+ /** Nodes short of `node_limit` after admission (server 1.14+). */
1174
+ backfill_shortfall?: number;
1175
+ };
1176
+ /** The "now" anchor: `as_of` when given, else the request date (server 1.14+). */
1177
+ now?: string;
1178
+ /** Unresolved contradiction pairs among the returned nodes (server 1.14+). */
1179
+ conflicts?: Array<Record<string, unknown>>;
1180
+ retrieval_mode?: "exhaustive";
1181
+ retrieval_mode_source?: "request" | "cue";
1182
+ /** Present with `format: "text"`. */
1183
+ context_text?: string;
1184
+ used_tokens?: number;
1185
+ truncated?: boolean;
1186
+ omitted?: {
1187
+ nodes: number;
1188
+ chunks: number;
1189
+ articles: number;
1190
+ conflicts: number;
1191
+ injections?: number;
1192
+ };
1078
1193
  articles?: ArticleResult[];
1079
1194
  chunks?: {
1080
1195
  chunk_uid: string;
@@ -1093,6 +1208,10 @@ interface RetrieveContextResponse {
1093
1208
  ingested_by?: string;
1094
1209
  /** Display name (else email) of the ingesting teammate. */
1095
1210
  ingested_by_name?: string;
1211
+ /** When the source conversation or document occurred (ISO-8601). */
1212
+ occurred_at?: string;
1213
+ /** Publication date of the source document (ISO-8601). */
1214
+ publication_date?: string;
1096
1215
  }[];
1097
1216
  source_chunks?: SourceChunk[];
1098
1217
  believed_by?: BelievedBy[];
@@ -1118,10 +1237,17 @@ interface RetrieveContextResponse {
1118
1237
  edges: Record<string, unknown>[];
1119
1238
  };
1120
1239
  }
1240
+ /** Safe terminal reason. This does not authorize replaying a whole job. */
1241
+ interface JobErrorDetails {
1242
+ code: string;
1243
+ message: string;
1244
+ status: number;
1245
+ retriable: boolean;
1246
+ }
1121
1247
  interface Job {
1122
1248
  id: string;
1123
1249
  title: string;
1124
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
1250
+ status: "pending" | "processing" | "completed" | "completed_with_errors" | "failed" | "cancelled";
1125
1251
  progress: {
1126
1252
  total_chunks: number;
1127
1253
  processed_chunks: number;
@@ -1130,6 +1256,8 @@ interface Job {
1130
1256
  };
1131
1257
  result: Record<string, unknown> | null;
1132
1258
  error: string | null;
1259
+ /** Absent for older servers or ordinary failures. */
1260
+ error_details?: JobErrorDetails | null;
1133
1261
  created_at: number;
1134
1262
  queue_position?: number;
1135
1263
  }
@@ -1537,6 +1665,8 @@ interface OntologySchema {
1537
1665
  propose_status?: "pending" | "running" | "ready" | "failed" | null;
1538
1666
  propose_job_id?: string | null;
1539
1667
  propose_error?: string | null;
1668
+ /** Durable terminal reason; absent on older servers. Review partial drafts before retry. */
1669
+ propose_error_details?: OntologyProposeErrorDetails | null;
1540
1670
  created_by?: string | null;
1541
1671
  updated_by?: string | null;
1542
1672
  created_at: string;
@@ -1679,7 +1809,11 @@ interface OntologyProposal {
1679
1809
  approval_uid?: string | null;
1680
1810
  proposed_node_uid?: string | null;
1681
1811
  applied_job_id?: string | null;
1812
+ /** Known result UID, including a partial result that needs reconciliation. */
1813
+ applied_uid?: string | null;
1682
1814
  applied_error?: string | null;
1815
+ /** A terminal execution failure; earlier graph changes may have committed. */
1816
+ applied_error_details?: OntologyApplyErrorDetails | null;
1683
1817
  apply_attempt_count: number;
1684
1818
  edited_by?: string | null;
1685
1819
  edited_at?: string | null;
@@ -1689,6 +1823,14 @@ interface OntologyProposal {
1689
1823
  resolved_at?: string | null;
1690
1824
  resolved_by?: string | null;
1691
1825
  }
1826
+ /** Proposal and apply failures share the safe terminal execution metadata. */
1827
+ type OntologyProposeErrorDetails = OntologyApplyErrorDetails;
1828
+ interface OntologyApplyErrorDetails {
1829
+ code: string;
1830
+ message: string;
1831
+ status: number;
1832
+ retriable: false;
1833
+ }
1692
1834
  interface OntologyDuplicateAudit {
1693
1835
  schema_id: string;
1694
1836
  object_groups: Array<{
@@ -2591,4 +2733,4 @@ declare class MindGraph {
2591
2733
  }>;
2592
2734
  }
2593
2735
 
2594
- export { type AggregatePoint, type AnalogyCandidate, type AppendSeriesResponse, type ArgumentRequest, type ArticleResult, type BatchAggregateSeriesResponse, type BatchLatestSeriesResponse, type BatchRequest, type BelievedBy, type CanonicalAttachmentAuthority, type CanonicalAttachmentBinding, type CanonicalAttachmentDirection, type CaptureRequest, type ClaimHub, type ClearResponse, type ClusterClaimSample, type ClusteredClaimHub, type CommitmentRequest, type ConceptCluster, type CreateDomainObjectRequest, type CreateOntologySchemaRequest, type CreateSeriesResponse, type DecayRequest, type DeleteSeriesResponse, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type DomainObject, type DomainObjectMutationResponse, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, type FiscalYearEnd, type ForgetOptions, type ForgetRequest, type ForgetResponse, type ForgetTarget, type GovernanceRequest, type GovernanceTarget, type GraphEdge, type GraphNode, type IngestChunkRequest, type IngestChunkResponse, type IngestDocumentRequest, type IngestDocumentResponse, type IngestSessionRequest, type InquiryRequest, type Job, type ListArticlesResponse, type ListSeriesResponse, type MeasurementPoint, type MemoryConfigRequest, type MemorySyncRequest, MindGraph, type MindGraphConfig, MindGraphError, type NationProps, type NormativeKind, type ObjectBacking, type OntologicalBaseKind, type OntologyDuplicateAudit, type OntologyObjectType, type OntologyObjectTypeInput, type OntologyPredicateOperator, type OntologyProposal, type OntologyQueryPredicate, type OntologyRelationType, type OntologyRelationTypeInput, type OntologySchema, type OntologySchemaDetail, type OntologySeriesBinding, type OntologyToolDescriptor, type OrganizationProps, type Participant, type ParticipantSlotKind, type PathStep, type PersonProps, type PlaceProps, type PlanRequest, type ProcedureRequest, type ProposalEdits, type PurgeRequest, type RankedClaimHub, type RelatedDomainObjectsRequest, type RelationBacking, type RememberOptions, type RememberRequest, type RememberResponse, type RetrieveContextRequest, type RetrieveContextResponse, type RetrieveRequest, type RiskRequest, type SearchChunk, type SearchResult, type SemanticDependence, type SemanticEvidenceRef, type SemanticEvidenceSourceKind, type SemanticGeneratorRef, type SemanticIdentityMode, type SemanticMatch, type SemanticMatchAlternative, type SemanticMatchStatus, type SemanticModifier, type SemanticModifierMatch, type SemanticNegativeControl, type SemanticParticipantSlot, type SemanticRelationKind, type SemanticReviewDecision, type SemanticRigidity, type SemanticRuntimeTemplate, type SemanticSignal, type SemanticSignalKind, type SemanticTemplateRef, type SemanticTemporalMode, type SemanticTenantBindings, type SemanticValidationAuthoringMode, type SemanticValidationMode, type SeriesAggregateResponse, type SeriesBacking, type SeriesContextAnnotation, type SeriesLatestResponse, type SeriesNode, type SeriesProps, type SeriesRequest, type SeriesWindowResponse, type SessionRequest, type SignalsQuery, type SignalsResponse, type SkillDistillProps, type SkillDistillRequest, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateDomainObjectRequest, type UpdateOntologySchemaRequest };
2736
+ export { type AggregatePoint, type AnalogyCandidate, type AppendSeriesResponse, type ArgumentRequest, type ArticleResult, type BatchAggregateSeriesResponse, type BatchLatestSeriesResponse, type BatchRequest, type BelievedBy, type CanonicalAttachmentAuthority, type CanonicalAttachmentBinding, type CanonicalAttachmentDirection, type CaptureRequest, type ClaimHub, type ClearResponse, type ClusterClaimSample, type ClusteredClaimHub, type CommitmentRequest, type ConceptCluster, type CreateDomainObjectRequest, type CreateOntologySchemaRequest, type CreateSeriesResponse, type DecayRequest, type DeleteSeriesResponse, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type DomainObject, type DomainObjectMutationResponse, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, type FiscalYearEnd, type ForgetOptions, type ForgetRequest, type ForgetResponse, type ForgetTarget, type GovernanceRequest, type GovernanceTarget, type GraphEdge, type GraphNode, type IngestChunkRequest, type IngestChunkResponse, type IngestDocumentRequest, type IngestDocumentResponse, type IngestSessionRequest, type InquiryRequest, type Job, type ListArticlesResponse, type ListSeriesResponse, type MeasurementPoint, type MemoryConfigRequest, type MemorySyncRequest, MindGraph, type MindGraphConfig, MindGraphError, type NationProps, type NormativeKind, type ObjectBacking, type OntologicalBaseKind, type OntologyApplyErrorDetails, type OntologyDuplicateAudit, type OntologyObjectType, type OntologyObjectTypeInput, type OntologyPredicateOperator, type OntologyProposal, type OntologyProposeErrorDetails, type OntologyQueryPredicate, type OntologyRelationType, type OntologyRelationTypeInput, type OntologySchema, type OntologySchemaDetail, type OntologySeriesBinding, type OntologyToolDescriptor, type OrganizationProps, type Participant, type ParticipantSlotKind, type PathStep, type PersonProps, type PlaceProps, type PlanRequest, type ProcedureRequest, type ProposalEdits, type PurgeRequest, type RankedClaimHub, type RelatedDomainObjectsRequest, type RelationBacking, type RememberOptions, type RememberRequest, type RememberResponse, type RetrieveContextRequest, type RetrieveContextResponse, type RetrieveRequest, type RiskRequest, type SearchChunk, type SearchResult, type SemanticDependence, type SemanticEvidenceRef, type SemanticEvidenceSourceKind, type SemanticGeneratorRef, type SemanticIdentityMode, type SemanticMatch, type SemanticMatchAlternative, type SemanticMatchStatus, type SemanticModifier, type SemanticModifierMatch, type SemanticNegativeControl, type SemanticParticipantSlot, type SemanticRelationKind, type SemanticReviewDecision, type SemanticRigidity, type SemanticRuntimeTemplate, type SemanticSignal, type SemanticSignalKind, type SemanticTemplateRef, type SemanticTemporalMode, type SemanticTenantBindings, type SemanticValidationAuthoringMode, type SemanticValidationMode, type SeriesAggregateResponse, type SeriesBacking, type SeriesContextAnnotation, type SeriesLatestResponse, type SeriesNode, type SeriesProps, type SeriesRequest, type SeriesWindowResponse, type SessionRequest, type SignalsQuery, type SignalsResponse, type SkillDistillProps, type SkillDistillRequest, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateDomainObjectRequest, type UpdateOntologySchemaRequest };
package/dist/index.d.ts CHANGED
@@ -779,7 +779,7 @@ interface RetrieveRequest {
779
779
  * Retrieval action. Note: `"semantic"` requires a configured embedding
780
780
  * provider on the server; for semantic search use `retrieveContext()` instead.
781
781
  */
782
- action: "text" | "semantic" | "hybrid" | "active_goals" | "open_questions" | "weak_claims" | "pending_approvals" | "unresolved_contradictions" | "stale_derivations" | "preferences" | "layer" | "recent";
782
+ action: "text" | "semantic" | "hybrid" | "active_goals" | "open_questions" | "weak_claims" | "pending_approvals" | "unresolved_contradictions" | "merge_candidates" | "stale_derivations" | "curation_counts" | "preferences" | "layer" | "recent";
783
783
  /**
784
784
  * Required for `"text"`, `"semantic"`, `"hybrid"`. Optional for
785
785
  * `"preferences"`: with a `query` you get topic-relevant preferences (the
@@ -823,6 +823,13 @@ interface RetrieveRequest {
823
823
  * provenance for citing "which teammate's notes" (D3). Requires server ≥ 1.8.0.
824
824
  */
825
825
  include_sources?: boolean;
826
+ /** Re-admit operational ledger and work-state nodes, excluded by default. */
827
+ include_ledger?: boolean;
828
+ /**
829
+ * Post-filter on how the node was created: `"document"`, `"session"` or
830
+ * `"agent"`.
831
+ */
832
+ source?: "document" | "session" | "agent";
826
833
  }
827
834
  interface TraverseRequest {
828
835
  action: "chain" | "neighborhood" | "path" | "subgraph" | "top_k_paths";
@@ -994,6 +1001,81 @@ interface RetrieveContextRequest {
994
1001
  * Windowed nodes then carry `valid_at_time` instead of `currently_valid`.
995
1002
  */
996
1003
  valid_at?: string;
1004
+ /**
1005
+ * Point-in-time perspective: answer with what had been **stated** by this
1006
+ * ISO-8601 date. A node is admitted when at least one of its source
1007
+ * documents was stated (`occurred_at`, else `publication_date`) on or
1008
+ * before the date; its own fact dates never exclude it (a plan stated in
1009
+ * June about next year is admitted). Nodes stated on both sides of the
1010
+ * date keep only their earlier sources and withhold the merged summary
1011
+ * (`spans_as_of`); undated nodes stay; closed claims stay (annotated
1012
+ * `valid_at_time: false`). Also sets the validity-annotation reference
1013
+ * when `valid_at` is absent. Wiki articles are skipped under a
1014
+ * time-scoped read. The response's `time_filter.axis` is
1015
+ * `statement_time`; use `occurred_from` / `occurred_to` for a fact-time
1016
+ * window. (Server 1.14+: before, `as_of` filtered on fact time.)
1017
+ */
1018
+ as_of?: string;
1019
+ /**
1020
+ * Inclusive occurrence window (ISO-8601, imprecision ok): only nodes and
1021
+ * chunks whose effective interval overlaps it are returned. Undated nodes
1022
+ * are excluded under a window. Either bound may be omitted.
1023
+ */
1024
+ /**
1025
+ * Evidence plan R2 (server 1.14+): `"text"` adds `context_text`,
1026
+ * `used_tokens`, `truncated` and `omitted` — the canonical rendering every
1027
+ * door shares (dated items, supersession and conflict markers, a hard
1028
+ * budget). Default `"json"`.
1029
+ */
1030
+ format?: "json" | "text";
1031
+ /** Token budget for `format: "text"` (minimum 256; default 8000). */
1032
+ max_tokens?: number;
1033
+ /** Order of `graph.nodes` in the JSON: `"rank"` (default) or `"chronological"`. */
1034
+ sort?: "rank" | "chronological";
1035
+ /**
1036
+ * `"exhaustive"` widens retrieval for list/count questions; omitted lets
1037
+ * the server's enumeration cue decide.
1038
+ */
1039
+ retrieval_mode?: "normal" | "exhaustive";
1040
+ occurred_from?: string;
1041
+ occurred_to?: string;
1042
+ /**
1043
+ * Re-admit operational ledger and work-state nodes (sessions, executions,
1044
+ * tasks, plans). Excluded from knowledge retrieval by default.
1045
+ */
1046
+ include_ledger?: boolean;
1047
+ /**
1048
+ * Bound each article's `content` to this many characters by query-aware
1049
+ * excerpting (default 6000; 0 = unlimited). The response flags `excerpted`.
1050
+ */
1051
+ article_char_limit?: number;
1052
+ /** Cosine floor for admitted articles (default 0 = off). */
1053
+ article_min_similarity?: number;
1054
+ /**
1055
+ * Attach per-leg hybrid contributions (`retrieval_legs`) to direct nodes.
1056
+ * Honored only for unscoped callers.
1057
+ */
1058
+ explain?: boolean;
1059
+ /**
1060
+ * Ontology leg control: `mode` `"auto"` (default) or `"off"`, optionally
1061
+ * restricted to one active schema. The leg runs only when the server has it
1062
+ * enabled and the org has an active schema.
1063
+ */
1064
+ ontology?: {
1065
+ mode?: "auto" | "off";
1066
+ schema_id?: string;
1067
+ };
1068
+ /**
1069
+ * What the caller is doing right now (an agent's task, the last turns of a
1070
+ * conversation), at most 2,000 characters. Read only by the question-aware
1071
+ * reranker; never used as a search term and never stored.
1072
+ */
1073
+ intent?: string;
1074
+ /**
1075
+ * Apply the question-aware rerank to graph-expansion candidates. Omitted
1076
+ * uses the server default (off).
1077
+ */
1078
+ rerank?: boolean;
997
1079
  }
998
1080
  interface ArticleResult {
999
1081
  uid: string;
@@ -1075,6 +1157,39 @@ interface SeriesContextAnnotation {
1075
1157
  };
1076
1158
  }
1077
1159
  interface RetrieveContextResponse {
1160
+ /**
1161
+ * Present only when the request set `as_of`, `occurred_from` or
1162
+ * `occurred_to`: the echoed filter plus what it excluded. World time only.
1163
+ */
1164
+ time_filter?: {
1165
+ as_of?: string;
1166
+ occurred_from?: string;
1167
+ occurred_to?: string;
1168
+ nodes_excluded: number;
1169
+ chunks_excluded: number;
1170
+ articles_excluded: boolean;
1171
+ /** `statement_time` under `as_of` (server 1.14+), `world_time` under a window. */
1172
+ axis: "world_time" | "statement_time";
1173
+ /** Nodes short of `node_limit` after admission (server 1.14+). */
1174
+ backfill_shortfall?: number;
1175
+ };
1176
+ /** The "now" anchor: `as_of` when given, else the request date (server 1.14+). */
1177
+ now?: string;
1178
+ /** Unresolved contradiction pairs among the returned nodes (server 1.14+). */
1179
+ conflicts?: Array<Record<string, unknown>>;
1180
+ retrieval_mode?: "exhaustive";
1181
+ retrieval_mode_source?: "request" | "cue";
1182
+ /** Present with `format: "text"`. */
1183
+ context_text?: string;
1184
+ used_tokens?: number;
1185
+ truncated?: boolean;
1186
+ omitted?: {
1187
+ nodes: number;
1188
+ chunks: number;
1189
+ articles: number;
1190
+ conflicts: number;
1191
+ injections?: number;
1192
+ };
1078
1193
  articles?: ArticleResult[];
1079
1194
  chunks?: {
1080
1195
  chunk_uid: string;
@@ -1093,6 +1208,10 @@ interface RetrieveContextResponse {
1093
1208
  ingested_by?: string;
1094
1209
  /** Display name (else email) of the ingesting teammate. */
1095
1210
  ingested_by_name?: string;
1211
+ /** When the source conversation or document occurred (ISO-8601). */
1212
+ occurred_at?: string;
1213
+ /** Publication date of the source document (ISO-8601). */
1214
+ publication_date?: string;
1096
1215
  }[];
1097
1216
  source_chunks?: SourceChunk[];
1098
1217
  believed_by?: BelievedBy[];
@@ -1118,10 +1237,17 @@ interface RetrieveContextResponse {
1118
1237
  edges: Record<string, unknown>[];
1119
1238
  };
1120
1239
  }
1240
+ /** Safe terminal reason. This does not authorize replaying a whole job. */
1241
+ interface JobErrorDetails {
1242
+ code: string;
1243
+ message: string;
1244
+ status: number;
1245
+ retriable: boolean;
1246
+ }
1121
1247
  interface Job {
1122
1248
  id: string;
1123
1249
  title: string;
1124
- status: "pending" | "processing" | "completed" | "failed" | "cancelled";
1250
+ status: "pending" | "processing" | "completed" | "completed_with_errors" | "failed" | "cancelled";
1125
1251
  progress: {
1126
1252
  total_chunks: number;
1127
1253
  processed_chunks: number;
@@ -1130,6 +1256,8 @@ interface Job {
1130
1256
  };
1131
1257
  result: Record<string, unknown> | null;
1132
1258
  error: string | null;
1259
+ /** Absent for older servers or ordinary failures. */
1260
+ error_details?: JobErrorDetails | null;
1133
1261
  created_at: number;
1134
1262
  queue_position?: number;
1135
1263
  }
@@ -1537,6 +1665,8 @@ interface OntologySchema {
1537
1665
  propose_status?: "pending" | "running" | "ready" | "failed" | null;
1538
1666
  propose_job_id?: string | null;
1539
1667
  propose_error?: string | null;
1668
+ /** Durable terminal reason; absent on older servers. Review partial drafts before retry. */
1669
+ propose_error_details?: OntologyProposeErrorDetails | null;
1540
1670
  created_by?: string | null;
1541
1671
  updated_by?: string | null;
1542
1672
  created_at: string;
@@ -1679,7 +1809,11 @@ interface OntologyProposal {
1679
1809
  approval_uid?: string | null;
1680
1810
  proposed_node_uid?: string | null;
1681
1811
  applied_job_id?: string | null;
1812
+ /** Known result UID, including a partial result that needs reconciliation. */
1813
+ applied_uid?: string | null;
1682
1814
  applied_error?: string | null;
1815
+ /** A terminal execution failure; earlier graph changes may have committed. */
1816
+ applied_error_details?: OntologyApplyErrorDetails | null;
1683
1817
  apply_attempt_count: number;
1684
1818
  edited_by?: string | null;
1685
1819
  edited_at?: string | null;
@@ -1689,6 +1823,14 @@ interface OntologyProposal {
1689
1823
  resolved_at?: string | null;
1690
1824
  resolved_by?: string | null;
1691
1825
  }
1826
+ /** Proposal and apply failures share the safe terminal execution metadata. */
1827
+ type OntologyProposeErrorDetails = OntologyApplyErrorDetails;
1828
+ interface OntologyApplyErrorDetails {
1829
+ code: string;
1830
+ message: string;
1831
+ status: number;
1832
+ retriable: false;
1833
+ }
1692
1834
  interface OntologyDuplicateAudit {
1693
1835
  schema_id: string;
1694
1836
  object_groups: Array<{
@@ -2591,4 +2733,4 @@ declare class MindGraph {
2591
2733
  }>;
2592
2734
  }
2593
2735
 
2594
- export { type AggregatePoint, type AnalogyCandidate, type AppendSeriesResponse, type ArgumentRequest, type ArticleResult, type BatchAggregateSeriesResponse, type BatchLatestSeriesResponse, type BatchRequest, type BelievedBy, type CanonicalAttachmentAuthority, type CanonicalAttachmentBinding, type CanonicalAttachmentDirection, type CaptureRequest, type ClaimHub, type ClearResponse, type ClusterClaimSample, type ClusteredClaimHub, type CommitmentRequest, type ConceptCluster, type CreateDomainObjectRequest, type CreateOntologySchemaRequest, type CreateSeriesResponse, type DecayRequest, type DeleteSeriesResponse, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type DomainObject, type DomainObjectMutationResponse, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, type FiscalYearEnd, type ForgetOptions, type ForgetRequest, type ForgetResponse, type ForgetTarget, type GovernanceRequest, type GovernanceTarget, type GraphEdge, type GraphNode, type IngestChunkRequest, type IngestChunkResponse, type IngestDocumentRequest, type IngestDocumentResponse, type IngestSessionRequest, type InquiryRequest, type Job, type ListArticlesResponse, type ListSeriesResponse, type MeasurementPoint, type MemoryConfigRequest, type MemorySyncRequest, MindGraph, type MindGraphConfig, MindGraphError, type NationProps, type NormativeKind, type ObjectBacking, type OntologicalBaseKind, type OntologyDuplicateAudit, type OntologyObjectType, type OntologyObjectTypeInput, type OntologyPredicateOperator, type OntologyProposal, type OntologyQueryPredicate, type OntologyRelationType, type OntologyRelationTypeInput, type OntologySchema, type OntologySchemaDetail, type OntologySeriesBinding, type OntologyToolDescriptor, type OrganizationProps, type Participant, type ParticipantSlotKind, type PathStep, type PersonProps, type PlaceProps, type PlanRequest, type ProcedureRequest, type ProposalEdits, type PurgeRequest, type RankedClaimHub, type RelatedDomainObjectsRequest, type RelationBacking, type RememberOptions, type RememberRequest, type RememberResponse, type RetrieveContextRequest, type RetrieveContextResponse, type RetrieveRequest, type RiskRequest, type SearchChunk, type SearchResult, type SemanticDependence, type SemanticEvidenceRef, type SemanticEvidenceSourceKind, type SemanticGeneratorRef, type SemanticIdentityMode, type SemanticMatch, type SemanticMatchAlternative, type SemanticMatchStatus, type SemanticModifier, type SemanticModifierMatch, type SemanticNegativeControl, type SemanticParticipantSlot, type SemanticRelationKind, type SemanticReviewDecision, type SemanticRigidity, type SemanticRuntimeTemplate, type SemanticSignal, type SemanticSignalKind, type SemanticTemplateRef, type SemanticTemporalMode, type SemanticTenantBindings, type SemanticValidationAuthoringMode, type SemanticValidationMode, type SeriesAggregateResponse, type SeriesBacking, type SeriesContextAnnotation, type SeriesLatestResponse, type SeriesNode, type SeriesProps, type SeriesRequest, type SeriesWindowResponse, type SessionRequest, type SignalsQuery, type SignalsResponse, type SkillDistillProps, type SkillDistillRequest, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateDomainObjectRequest, type UpdateOntologySchemaRequest };
2736
+ export { type AggregatePoint, type AnalogyCandidate, type AppendSeriesResponse, type ArgumentRequest, type ArticleResult, type BatchAggregateSeriesResponse, type BatchLatestSeriesResponse, type BatchRequest, type BelievedBy, type CanonicalAttachmentAuthority, type CanonicalAttachmentBinding, type CanonicalAttachmentDirection, type CaptureRequest, type ClaimHub, type ClearResponse, type ClusterClaimSample, type ClusteredClaimHub, type CommitmentRequest, type ConceptCluster, type CreateDomainObjectRequest, type CreateOntologySchemaRequest, type CreateSeriesResponse, type DecayRequest, type DeleteSeriesResponse, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type DomainObject, type DomainObjectMutationResponse, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, type FiscalYearEnd, type ForgetOptions, type ForgetRequest, type ForgetResponse, type ForgetTarget, type GovernanceRequest, type GovernanceTarget, type GraphEdge, type GraphNode, type IngestChunkRequest, type IngestChunkResponse, type IngestDocumentRequest, type IngestDocumentResponse, type IngestSessionRequest, type InquiryRequest, type Job, type ListArticlesResponse, type ListSeriesResponse, type MeasurementPoint, type MemoryConfigRequest, type MemorySyncRequest, MindGraph, type MindGraphConfig, MindGraphError, type NationProps, type NormativeKind, type ObjectBacking, type OntologicalBaseKind, type OntologyApplyErrorDetails, type OntologyDuplicateAudit, type OntologyObjectType, type OntologyObjectTypeInput, type OntologyPredicateOperator, type OntologyProposal, type OntologyProposeErrorDetails, type OntologyQueryPredicate, type OntologyRelationType, type OntologyRelationTypeInput, type OntologySchema, type OntologySchemaDetail, type OntologySeriesBinding, type OntologyToolDescriptor, type OrganizationProps, type Participant, type ParticipantSlotKind, type PathStep, type PersonProps, type PlaceProps, type PlanRequest, type ProcedureRequest, type ProposalEdits, type PurgeRequest, type RankedClaimHub, type RelatedDomainObjectsRequest, type RelationBacking, type RememberOptions, type RememberRequest, type RememberResponse, type RetrieveContextRequest, type RetrieveContextResponse, type RetrieveRequest, type RiskRequest, type SearchChunk, type SearchResult, type SemanticDependence, type SemanticEvidenceRef, type SemanticEvidenceSourceKind, type SemanticGeneratorRef, type SemanticIdentityMode, type SemanticMatch, type SemanticMatchAlternative, type SemanticMatchStatus, type SemanticModifier, type SemanticModifierMatch, type SemanticNegativeControl, type SemanticParticipantSlot, type SemanticRelationKind, type SemanticReviewDecision, type SemanticRigidity, type SemanticRuntimeTemplate, type SemanticSignal, type SemanticSignalKind, type SemanticTemplateRef, type SemanticTemporalMode, type SemanticTenantBindings, type SemanticValidationAuthoringMode, type SemanticValidationMode, type SeriesAggregateResponse, type SeriesBacking, type SeriesContextAnnotation, type SeriesLatestResponse, type SeriesNode, type SeriesProps, type SeriesRequest, type SeriesWindowResponse, type SessionRequest, type SignalsQuery, type SignalsResponse, type SkillDistillProps, type SkillDistillRequest, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateDomainObjectRequest, type UpdateOntologySchemaRequest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindgraph",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "TypeScript client for the MindGraph Cloud API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",