mindgraph 0.13.0 → 0.14.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/LICENSE +1 -1
- package/dist/index.d.mts +94 -4
- package/dist/index.d.ts +94 -4
- package/dist/index.js +52 -46
- package/dist/index.mjs +52 -46
- package/package.json +1 -1
package/LICENSE
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -190,7 +190,7 @@ interface CaptureRequest {
|
|
|
190
190
|
agent_id?: string;
|
|
191
191
|
}
|
|
192
192
|
interface EntityRequest {
|
|
193
|
-
action: "create" | "alias" | "resolve" | "fuzzy_resolve" | "merge" | "relate";
|
|
193
|
+
action: "create" | "resolve_identity" | "alias" | "resolve" | "fuzzy_resolve" | "merge" | "relate";
|
|
194
194
|
label?: string;
|
|
195
195
|
text?: string;
|
|
196
196
|
canonical_uid?: string;
|
|
@@ -203,6 +203,14 @@ interface EntityRequest {
|
|
|
203
203
|
edge_type?: string;
|
|
204
204
|
props?: Record<string, unknown>;
|
|
205
205
|
agent_id?: string;
|
|
206
|
+
/** Server-canonicalized exact identity. Values may contain only strings and integers. */
|
|
207
|
+
identity?: {
|
|
208
|
+
namespace: string;
|
|
209
|
+
key_version: 1;
|
|
210
|
+
key: unknown;
|
|
211
|
+
};
|
|
212
|
+
/** Explicit writable Project/repository/agent Space for an identity-backed create. */
|
|
213
|
+
identity_space_uid?: string;
|
|
206
214
|
}
|
|
207
215
|
interface ArgumentRequest {
|
|
208
216
|
claim: {
|
|
@@ -330,6 +338,9 @@ interface SessionRequest {
|
|
|
330
338
|
salience?: number;
|
|
331
339
|
session_uid?: string;
|
|
332
340
|
relevant_node_uids?: string[];
|
|
341
|
+
harness?: "claude-code" | "codex" | "generic";
|
|
342
|
+
harness_session_id?: string;
|
|
343
|
+
model?: string;
|
|
333
344
|
props?: Record<string, unknown>;
|
|
334
345
|
agent_id?: string;
|
|
335
346
|
}
|
|
@@ -342,6 +353,10 @@ interface DistillRequest {
|
|
|
342
353
|
salience?: number;
|
|
343
354
|
summarizes_uids?: string[];
|
|
344
355
|
session_uid?: string;
|
|
356
|
+
work_uid?: string;
|
|
357
|
+
execution_uid?: string;
|
|
358
|
+
idempotency_key?: string;
|
|
359
|
+
supersedes_uid?: string;
|
|
345
360
|
props?: Record<string, unknown>;
|
|
346
361
|
agent_id?: string;
|
|
347
362
|
}
|
|
@@ -354,8 +369,31 @@ interface MemoryConfigRequest {
|
|
|
354
369
|
props?: Record<string, unknown>;
|
|
355
370
|
agent_id?: string;
|
|
356
371
|
}
|
|
372
|
+
interface MemorySyncRequest {
|
|
373
|
+
action: "scan" | "begin" | "record" | "finalize" | "status" | "abandon";
|
|
374
|
+
provider?: string;
|
|
375
|
+
repo_id?: string;
|
|
376
|
+
logical_path?: string;
|
|
377
|
+
content_hash?: string;
|
|
378
|
+
content?: string;
|
|
379
|
+
source_uid?: string;
|
|
380
|
+
execution_uid?: string;
|
|
381
|
+
assertion_fingerprint?: string;
|
|
382
|
+
planned_fingerprints?: string[];
|
|
383
|
+
current_fingerprints?: string[];
|
|
384
|
+
source_selector?: Record<string, unknown>;
|
|
385
|
+
capture_type?: "lesson" | "journal" | "claim" | "decision" | "risk";
|
|
386
|
+
label?: string;
|
|
387
|
+
summary?: string;
|
|
388
|
+
props?: Record<string, unknown>;
|
|
389
|
+
expected_execution_version?: number;
|
|
390
|
+
baseline_version?: number;
|
|
391
|
+
repo_space_uid?: string;
|
|
392
|
+
file_present?: boolean;
|
|
393
|
+
agent_id?: string;
|
|
394
|
+
}
|
|
357
395
|
interface PlanRequest {
|
|
358
|
-
action: "create_task" | "create_plan" | "add_step" | "update_status" | "get_plan";
|
|
396
|
+
action: "create_task" | "create_plan" | "add_step" | "update_status" | "get_plan" | "resume_work" | "claim_task" | "heartbeat" | "start_iteration" | "checkpoint_iteration" | "block_task" | "complete_task" | "abandon_iteration";
|
|
359
397
|
label?: string;
|
|
360
398
|
summary?: string;
|
|
361
399
|
confidence?: number;
|
|
@@ -363,15 +401,39 @@ interface PlanRequest {
|
|
|
363
401
|
goal_uid?: string;
|
|
364
402
|
task_uid?: string;
|
|
365
403
|
plan_uid?: string;
|
|
404
|
+
step_uid?: string;
|
|
405
|
+
execution_uid?: string;
|
|
406
|
+
session_uid?: string;
|
|
366
407
|
depends_on_uids?: string[];
|
|
367
408
|
target_uid?: string;
|
|
368
409
|
status?: string;
|
|
410
|
+
task_status?: string;
|
|
411
|
+
step_status?: string;
|
|
412
|
+
execution_status?: "completed" | "failed" | "abandoned";
|
|
413
|
+
expected_version?: number;
|
|
414
|
+
lease_epoch?: number;
|
|
415
|
+
lease_ttl_secs?: number;
|
|
416
|
+
idempotency_key?: string;
|
|
417
|
+
allow_takeover?: boolean;
|
|
418
|
+
release_lease?: boolean;
|
|
419
|
+
override_reason?: string;
|
|
420
|
+
scope_uids?: string[];
|
|
421
|
+
limit?: number;
|
|
422
|
+
input_snapshot?: Record<string, unknown>;
|
|
423
|
+
output_snapshot?: Record<string, unknown>;
|
|
424
|
+
side_effects?: string[];
|
|
425
|
+
outcome?: string;
|
|
426
|
+
error?: string;
|
|
427
|
+
next_action?: string;
|
|
428
|
+
checkpoint_summary?: string;
|
|
429
|
+
test_summary?: string;
|
|
430
|
+
produces_node_uids?: string[];
|
|
369
431
|
related_uids?: string[];
|
|
370
432
|
props?: Record<string, unknown>;
|
|
371
433
|
agent_id?: string;
|
|
372
434
|
}
|
|
373
435
|
interface GovernanceRequest {
|
|
374
|
-
action: "create_policy" | "set_budget" | "request_approval" | "resolve_approval" | "get_pending";
|
|
436
|
+
action: "create_policy" | "set_budget" | "request_approval" | "resolve_approval" | "get_pending" | "check";
|
|
375
437
|
label?: string;
|
|
376
438
|
summary?: string;
|
|
377
439
|
confidence?: number;
|
|
@@ -380,9 +442,30 @@ interface GovernanceRequest {
|
|
|
380
442
|
approval_uid?: string;
|
|
381
443
|
approved?: boolean;
|
|
382
444
|
requires_plan_uid?: string;
|
|
445
|
+
act?: string;
|
|
446
|
+
target?: GovernanceTarget;
|
|
447
|
+
purpose?: string;
|
|
448
|
+
context?: Record<string, unknown>;
|
|
449
|
+
mode?: "permit_default" | "deny_default";
|
|
450
|
+
tier?: "native" | "checkpoint" | "advisory" | "dry_run";
|
|
383
451
|
props?: Record<string, unknown>;
|
|
384
452
|
agent_id?: string;
|
|
385
453
|
}
|
|
454
|
+
interface GovernanceTarget {
|
|
455
|
+
node_uid?: string;
|
|
456
|
+
document_uid?: string;
|
|
457
|
+
node_type?: string;
|
|
458
|
+
ontology_class?: string;
|
|
459
|
+
tags?: string[];
|
|
460
|
+
space?: string;
|
|
461
|
+
classifications?: string[];
|
|
462
|
+
tool_name?: string;
|
|
463
|
+
tool_annotations?: string[];
|
|
464
|
+
execution_uid?: string;
|
|
465
|
+
action?: string;
|
|
466
|
+
mutability?: "read" | "write";
|
|
467
|
+
target_uids?: string[];
|
|
468
|
+
}
|
|
386
469
|
interface ExecutionRequest {
|
|
387
470
|
action: "start" | "complete" | "fail" | "register_agent" | "get_executions";
|
|
388
471
|
label?: string;
|
|
@@ -391,10 +474,16 @@ interface ExecutionRequest {
|
|
|
391
474
|
salience?: number;
|
|
392
475
|
plan_uid?: string;
|
|
393
476
|
executor_uid?: string;
|
|
477
|
+
affordance_uid?: string;
|
|
394
478
|
execution_uid?: string;
|
|
395
479
|
produces_node_uid?: string;
|
|
396
480
|
filter_plan_uid?: string;
|
|
397
481
|
related_uids?: string[];
|
|
482
|
+
input_snapshot?: Record<string, unknown>;
|
|
483
|
+
output_snapshot?: Record<string, unknown>;
|
|
484
|
+
side_effects?: string[];
|
|
485
|
+
outcome?: string;
|
|
486
|
+
error?: string;
|
|
398
487
|
props?: Record<string, unknown>;
|
|
399
488
|
agent_id?: string;
|
|
400
489
|
}
|
|
@@ -1585,6 +1674,7 @@ declare class MindGraph {
|
|
|
1585
1674
|
}): Promise<unknown>;
|
|
1586
1675
|
distill(req: DistillRequest): Promise<unknown>;
|
|
1587
1676
|
memoryConfig(req: MemoryConfigRequest): Promise<unknown>;
|
|
1677
|
+
memorySync(req: MemorySyncRequest): Promise<unknown>;
|
|
1588
1678
|
plan(req: PlanRequest): Promise<unknown>;
|
|
1589
1679
|
governance(req: GovernanceRequest): Promise<unknown>;
|
|
1590
1680
|
execution(req: ExecutionRequest): Promise<unknown>;
|
|
@@ -2029,4 +2119,4 @@ declare class MindGraph {
|
|
|
2029
2119
|
}>;
|
|
2030
2120
|
}
|
|
2031
2121
|
|
|
2032
|
-
export { type AnalogyCandidate, type ArgumentRequest, type ArticleResult, 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 CreateOntologySchemaRequest, type DecayRequest, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, type GovernanceRequest, type GraphEdge, type GraphNode, type IngestChunkRequest, type IngestChunkResponse, type IngestDocumentRequest, type IngestDocumentResponse, type IngestSessionRequest, type InquiryRequest, type Job, type ListArticlesResponse, type MemoryConfigRequest, 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 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 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 SessionRequest, type SignalsQuery, type SignalsResponse, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateOntologySchemaRequest };
|
|
2122
|
+
export { type AnalogyCandidate, type ArgumentRequest, type ArticleResult, 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 CreateOntologySchemaRequest, type DecayRequest, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, 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 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 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 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 SessionRequest, type SignalsQuery, type SignalsResponse, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateOntologySchemaRequest };
|
package/dist/index.d.ts
CHANGED
|
@@ -190,7 +190,7 @@ interface CaptureRequest {
|
|
|
190
190
|
agent_id?: string;
|
|
191
191
|
}
|
|
192
192
|
interface EntityRequest {
|
|
193
|
-
action: "create" | "alias" | "resolve" | "fuzzy_resolve" | "merge" | "relate";
|
|
193
|
+
action: "create" | "resolve_identity" | "alias" | "resolve" | "fuzzy_resolve" | "merge" | "relate";
|
|
194
194
|
label?: string;
|
|
195
195
|
text?: string;
|
|
196
196
|
canonical_uid?: string;
|
|
@@ -203,6 +203,14 @@ interface EntityRequest {
|
|
|
203
203
|
edge_type?: string;
|
|
204
204
|
props?: Record<string, unknown>;
|
|
205
205
|
agent_id?: string;
|
|
206
|
+
/** Server-canonicalized exact identity. Values may contain only strings and integers. */
|
|
207
|
+
identity?: {
|
|
208
|
+
namespace: string;
|
|
209
|
+
key_version: 1;
|
|
210
|
+
key: unknown;
|
|
211
|
+
};
|
|
212
|
+
/** Explicit writable Project/repository/agent Space for an identity-backed create. */
|
|
213
|
+
identity_space_uid?: string;
|
|
206
214
|
}
|
|
207
215
|
interface ArgumentRequest {
|
|
208
216
|
claim: {
|
|
@@ -330,6 +338,9 @@ interface SessionRequest {
|
|
|
330
338
|
salience?: number;
|
|
331
339
|
session_uid?: string;
|
|
332
340
|
relevant_node_uids?: string[];
|
|
341
|
+
harness?: "claude-code" | "codex" | "generic";
|
|
342
|
+
harness_session_id?: string;
|
|
343
|
+
model?: string;
|
|
333
344
|
props?: Record<string, unknown>;
|
|
334
345
|
agent_id?: string;
|
|
335
346
|
}
|
|
@@ -342,6 +353,10 @@ interface DistillRequest {
|
|
|
342
353
|
salience?: number;
|
|
343
354
|
summarizes_uids?: string[];
|
|
344
355
|
session_uid?: string;
|
|
356
|
+
work_uid?: string;
|
|
357
|
+
execution_uid?: string;
|
|
358
|
+
idempotency_key?: string;
|
|
359
|
+
supersedes_uid?: string;
|
|
345
360
|
props?: Record<string, unknown>;
|
|
346
361
|
agent_id?: string;
|
|
347
362
|
}
|
|
@@ -354,8 +369,31 @@ interface MemoryConfigRequest {
|
|
|
354
369
|
props?: Record<string, unknown>;
|
|
355
370
|
agent_id?: string;
|
|
356
371
|
}
|
|
372
|
+
interface MemorySyncRequest {
|
|
373
|
+
action: "scan" | "begin" | "record" | "finalize" | "status" | "abandon";
|
|
374
|
+
provider?: string;
|
|
375
|
+
repo_id?: string;
|
|
376
|
+
logical_path?: string;
|
|
377
|
+
content_hash?: string;
|
|
378
|
+
content?: string;
|
|
379
|
+
source_uid?: string;
|
|
380
|
+
execution_uid?: string;
|
|
381
|
+
assertion_fingerprint?: string;
|
|
382
|
+
planned_fingerprints?: string[];
|
|
383
|
+
current_fingerprints?: string[];
|
|
384
|
+
source_selector?: Record<string, unknown>;
|
|
385
|
+
capture_type?: "lesson" | "journal" | "claim" | "decision" | "risk";
|
|
386
|
+
label?: string;
|
|
387
|
+
summary?: string;
|
|
388
|
+
props?: Record<string, unknown>;
|
|
389
|
+
expected_execution_version?: number;
|
|
390
|
+
baseline_version?: number;
|
|
391
|
+
repo_space_uid?: string;
|
|
392
|
+
file_present?: boolean;
|
|
393
|
+
agent_id?: string;
|
|
394
|
+
}
|
|
357
395
|
interface PlanRequest {
|
|
358
|
-
action: "create_task" | "create_plan" | "add_step" | "update_status" | "get_plan";
|
|
396
|
+
action: "create_task" | "create_plan" | "add_step" | "update_status" | "get_plan" | "resume_work" | "claim_task" | "heartbeat" | "start_iteration" | "checkpoint_iteration" | "block_task" | "complete_task" | "abandon_iteration";
|
|
359
397
|
label?: string;
|
|
360
398
|
summary?: string;
|
|
361
399
|
confidence?: number;
|
|
@@ -363,15 +401,39 @@ interface PlanRequest {
|
|
|
363
401
|
goal_uid?: string;
|
|
364
402
|
task_uid?: string;
|
|
365
403
|
plan_uid?: string;
|
|
404
|
+
step_uid?: string;
|
|
405
|
+
execution_uid?: string;
|
|
406
|
+
session_uid?: string;
|
|
366
407
|
depends_on_uids?: string[];
|
|
367
408
|
target_uid?: string;
|
|
368
409
|
status?: string;
|
|
410
|
+
task_status?: string;
|
|
411
|
+
step_status?: string;
|
|
412
|
+
execution_status?: "completed" | "failed" | "abandoned";
|
|
413
|
+
expected_version?: number;
|
|
414
|
+
lease_epoch?: number;
|
|
415
|
+
lease_ttl_secs?: number;
|
|
416
|
+
idempotency_key?: string;
|
|
417
|
+
allow_takeover?: boolean;
|
|
418
|
+
release_lease?: boolean;
|
|
419
|
+
override_reason?: string;
|
|
420
|
+
scope_uids?: string[];
|
|
421
|
+
limit?: number;
|
|
422
|
+
input_snapshot?: Record<string, unknown>;
|
|
423
|
+
output_snapshot?: Record<string, unknown>;
|
|
424
|
+
side_effects?: string[];
|
|
425
|
+
outcome?: string;
|
|
426
|
+
error?: string;
|
|
427
|
+
next_action?: string;
|
|
428
|
+
checkpoint_summary?: string;
|
|
429
|
+
test_summary?: string;
|
|
430
|
+
produces_node_uids?: string[];
|
|
369
431
|
related_uids?: string[];
|
|
370
432
|
props?: Record<string, unknown>;
|
|
371
433
|
agent_id?: string;
|
|
372
434
|
}
|
|
373
435
|
interface GovernanceRequest {
|
|
374
|
-
action: "create_policy" | "set_budget" | "request_approval" | "resolve_approval" | "get_pending";
|
|
436
|
+
action: "create_policy" | "set_budget" | "request_approval" | "resolve_approval" | "get_pending" | "check";
|
|
375
437
|
label?: string;
|
|
376
438
|
summary?: string;
|
|
377
439
|
confidence?: number;
|
|
@@ -380,9 +442,30 @@ interface GovernanceRequest {
|
|
|
380
442
|
approval_uid?: string;
|
|
381
443
|
approved?: boolean;
|
|
382
444
|
requires_plan_uid?: string;
|
|
445
|
+
act?: string;
|
|
446
|
+
target?: GovernanceTarget;
|
|
447
|
+
purpose?: string;
|
|
448
|
+
context?: Record<string, unknown>;
|
|
449
|
+
mode?: "permit_default" | "deny_default";
|
|
450
|
+
tier?: "native" | "checkpoint" | "advisory" | "dry_run";
|
|
383
451
|
props?: Record<string, unknown>;
|
|
384
452
|
agent_id?: string;
|
|
385
453
|
}
|
|
454
|
+
interface GovernanceTarget {
|
|
455
|
+
node_uid?: string;
|
|
456
|
+
document_uid?: string;
|
|
457
|
+
node_type?: string;
|
|
458
|
+
ontology_class?: string;
|
|
459
|
+
tags?: string[];
|
|
460
|
+
space?: string;
|
|
461
|
+
classifications?: string[];
|
|
462
|
+
tool_name?: string;
|
|
463
|
+
tool_annotations?: string[];
|
|
464
|
+
execution_uid?: string;
|
|
465
|
+
action?: string;
|
|
466
|
+
mutability?: "read" | "write";
|
|
467
|
+
target_uids?: string[];
|
|
468
|
+
}
|
|
386
469
|
interface ExecutionRequest {
|
|
387
470
|
action: "start" | "complete" | "fail" | "register_agent" | "get_executions";
|
|
388
471
|
label?: string;
|
|
@@ -391,10 +474,16 @@ interface ExecutionRequest {
|
|
|
391
474
|
salience?: number;
|
|
392
475
|
plan_uid?: string;
|
|
393
476
|
executor_uid?: string;
|
|
477
|
+
affordance_uid?: string;
|
|
394
478
|
execution_uid?: string;
|
|
395
479
|
produces_node_uid?: string;
|
|
396
480
|
filter_plan_uid?: string;
|
|
397
481
|
related_uids?: string[];
|
|
482
|
+
input_snapshot?: Record<string, unknown>;
|
|
483
|
+
output_snapshot?: Record<string, unknown>;
|
|
484
|
+
side_effects?: string[];
|
|
485
|
+
outcome?: string;
|
|
486
|
+
error?: string;
|
|
398
487
|
props?: Record<string, unknown>;
|
|
399
488
|
agent_id?: string;
|
|
400
489
|
}
|
|
@@ -1585,6 +1674,7 @@ declare class MindGraph {
|
|
|
1585
1674
|
}): Promise<unknown>;
|
|
1586
1675
|
distill(req: DistillRequest): Promise<unknown>;
|
|
1587
1676
|
memoryConfig(req: MemoryConfigRequest): Promise<unknown>;
|
|
1677
|
+
memorySync(req: MemorySyncRequest): Promise<unknown>;
|
|
1588
1678
|
plan(req: PlanRequest): Promise<unknown>;
|
|
1589
1679
|
governance(req: GovernanceRequest): Promise<unknown>;
|
|
1590
1680
|
execution(req: ExecutionRequest): Promise<unknown>;
|
|
@@ -2029,4 +2119,4 @@ declare class MindGraph {
|
|
|
2029
2119
|
}>;
|
|
2030
2120
|
}
|
|
2031
2121
|
|
|
2032
|
-
export { type AnalogyCandidate, type ArgumentRequest, type ArticleResult, 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 CreateOntologySchemaRequest, type DecayRequest, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, type GovernanceRequest, type GraphEdge, type GraphNode, type IngestChunkRequest, type IngestChunkResponse, type IngestDocumentRequest, type IngestDocumentResponse, type IngestSessionRequest, type InquiryRequest, type Job, type ListArticlesResponse, type MemoryConfigRequest, 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 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 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 SessionRequest, type SignalsQuery, type SignalsResponse, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateOntologySchemaRequest };
|
|
2122
|
+
export { type AnalogyCandidate, type ArgumentRequest, type ArticleResult, 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 CreateOntologySchemaRequest, type DecayRequest, type DeliberationRequest, type DialecticalPair, type DistillRequest, type DocumentRef, type EnrichedSearchResponse, type EntityBridge, type EntityRequest, type EpistemicCounts, type EventProps, type EvolveRequest, type ExecutionRequest, type FieldDefinition, type FieldSemantic, type FieldSemanticKind, 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 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 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 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 SessionRequest, type SignalsQuery, type SignalsResponse, type SourceChunk, type StructureRequest, type StructuredOntologyQueryRequest, type StructuredOntologyQueryResponse, type SynthesisJobResponse, type TextSelector, type TheorySupportGap, type TraverseRequest, type UpdateOntologySchemaRequest };
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,9 @@ __export(index_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
27
|
|
|
28
28
|
// src/client.ts
|
|
29
|
+
function seg(value) {
|
|
30
|
+
return encodeURIComponent(String(value));
|
|
31
|
+
}
|
|
29
32
|
var MindGraphError = class extends Error {
|
|
30
33
|
constructor(message, status, body) {
|
|
31
34
|
super(message);
|
|
@@ -295,6 +298,9 @@ var MindGraph = class {
|
|
|
295
298
|
async memoryConfig(req) {
|
|
296
299
|
return this.post("/memory/config", req);
|
|
297
300
|
}
|
|
301
|
+
async memorySync(req) {
|
|
302
|
+
return this.post("/memory/sync", req);
|
|
303
|
+
}
|
|
298
304
|
// ---- Agent Layer ----
|
|
299
305
|
async plan(req) {
|
|
300
306
|
return this.post("/agent/plan", req);
|
|
@@ -318,7 +324,7 @@ var MindGraph = class {
|
|
|
318
324
|
}
|
|
319
325
|
// ---- Node CRUD ----
|
|
320
326
|
async getNode(uid) {
|
|
321
|
-
return this.get(`/node/${uid}`);
|
|
327
|
+
return this.get(`/node/${seg(uid)}`);
|
|
322
328
|
}
|
|
323
329
|
/**
|
|
324
330
|
* Create a node via the low-level CRUD endpoint.
|
|
@@ -335,10 +341,10 @@ var MindGraph = class {
|
|
|
335
341
|
return this.post("/node", { ...body, props });
|
|
336
342
|
}
|
|
337
343
|
async updateNode(uid, body) {
|
|
338
|
-
return this.patch(`/node/${uid}`, body);
|
|
344
|
+
return this.patch(`/node/${seg(uid)}`, body);
|
|
339
345
|
}
|
|
340
346
|
async deleteNode(uid) {
|
|
341
|
-
await this.del(`/node/${uid}`);
|
|
347
|
+
await this.del(`/node/${seg(uid)}`);
|
|
342
348
|
}
|
|
343
349
|
async batchDeleteNodes(params) {
|
|
344
350
|
const body = {};
|
|
@@ -359,10 +365,10 @@ var MindGraph = class {
|
|
|
359
365
|
return this.post("/nodes/delete", body);
|
|
360
366
|
}
|
|
361
367
|
async getNodeHistory(uid) {
|
|
362
|
-
return this.get(`/node/${uid}/history`);
|
|
368
|
+
return this.get(`/node/${seg(uid)}/history`);
|
|
363
369
|
}
|
|
364
370
|
async getNodeAtVersion(uid, version) {
|
|
365
|
-
return this.get(`/node/${uid}/history/${version}`);
|
|
371
|
+
return this.get(`/node/${seg(uid)}/history/${seg(version)}`);
|
|
366
372
|
}
|
|
367
373
|
// ---- Edge CRUD ----
|
|
368
374
|
async addLink(body) {
|
|
@@ -383,13 +389,13 @@ var MindGraph = class {
|
|
|
383
389
|
return this.post("/edge", { ...body, props });
|
|
384
390
|
}
|
|
385
391
|
async updateEdge(uid, body) {
|
|
386
|
-
return this.patch(`/edge/${uid}`, body);
|
|
392
|
+
return this.patch(`/edge/${seg(uid)}`, body);
|
|
387
393
|
}
|
|
388
394
|
async deleteEdge(uid) {
|
|
389
|
-
await this.del(`/edge/${uid}`);
|
|
395
|
+
await this.del(`/edge/${seg(uid)}`);
|
|
390
396
|
}
|
|
391
397
|
async getEdgeHistory(uid) {
|
|
392
|
-
return this.get(`/edge/${uid}/history`);
|
|
398
|
+
return this.get(`/edge/${seg(uid)}/history`);
|
|
393
399
|
}
|
|
394
400
|
/**
|
|
395
401
|
* List edges filtered by source and/or target node.
|
|
@@ -438,7 +444,7 @@ var MindGraph = class {
|
|
|
438
444
|
return this.get(`/nodes?${qs}`);
|
|
439
445
|
}
|
|
440
446
|
async getAgentNodes(agentId) {
|
|
441
|
-
return this.get(`/agent/${agentId}/nodes`);
|
|
447
|
+
return this.get(`/agent/${seg(agentId)}/nodes`);
|
|
442
448
|
}
|
|
443
449
|
// ---- Batch ----
|
|
444
450
|
async batch(req) {
|
|
@@ -463,13 +469,13 @@ var MindGraph = class {
|
|
|
463
469
|
return this.post("/embeddings/search-text", body);
|
|
464
470
|
}
|
|
465
471
|
async getEmbedding(uid) {
|
|
466
|
-
return this.get(`/node/${uid}/embedding`);
|
|
472
|
+
return this.get(`/node/${seg(uid)}/embedding`);
|
|
467
473
|
}
|
|
468
474
|
async setEmbedding(uid, vector) {
|
|
469
|
-
await this.request("PUT", `/node/${uid}/embedding`, { vector });
|
|
475
|
+
await this.request("PUT", `/node/${seg(uid)}/embedding`, { vector });
|
|
470
476
|
}
|
|
471
477
|
async deleteEmbedding(uid) {
|
|
472
|
-
await this.del(`/node/${uid}/embedding`);
|
|
478
|
+
await this.del(`/node/${seg(uid)}/embedding`);
|
|
473
479
|
}
|
|
474
480
|
// ---- Entity resolution ----
|
|
475
481
|
async mergeEntities(body) {
|
|
@@ -479,7 +485,7 @@ var MindGraph = class {
|
|
|
479
485
|
return this.post("/alias", body);
|
|
480
486
|
}
|
|
481
487
|
async getAliases(uid) {
|
|
482
|
-
return this.get(`/aliases/${uid}`);
|
|
488
|
+
return this.get(`/aliases/${seg(uid)}`);
|
|
483
489
|
}
|
|
484
490
|
async resolveAlias(text) {
|
|
485
491
|
return this.get(`/resolve?text=${encodeURIComponent(text)}`);
|
|
@@ -602,18 +608,18 @@ var MindGraph = class {
|
|
|
602
608
|
return this.get("/jobs");
|
|
603
609
|
}
|
|
604
610
|
async getJob(id) {
|
|
605
|
-
return this.get(`/jobs/${id}`);
|
|
611
|
+
return this.get(`/jobs/${seg(id)}`);
|
|
606
612
|
}
|
|
607
613
|
async cancelJob(id) {
|
|
608
|
-
return this.post(`/jobs/${id}/cancel`, {});
|
|
614
|
+
return this.post(`/jobs/${seg(id)}/cancel`, {});
|
|
609
615
|
}
|
|
610
616
|
/** Resume ingestion of a document that has failed chunks. */
|
|
611
617
|
async resumeDocument(docUid, opts) {
|
|
612
|
-
return this.post(`/ingest/resume/${docUid}`, opts ?? {});
|
|
618
|
+
return this.post(`/ingest/resume/${seg(docUid)}`, opts ?? {});
|
|
613
619
|
}
|
|
614
620
|
/** Delete a document and all its chunks and extracted nodes. */
|
|
615
621
|
async deleteDocument(uid) {
|
|
616
|
-
return this.del(`/ingest/document/${uid}`);
|
|
622
|
+
return this.del(`/ingest/document/${seg(uid)}`);
|
|
617
623
|
}
|
|
618
624
|
async cleanupOrphans() {
|
|
619
625
|
return this.post("/ingest/cleanup", {});
|
|
@@ -637,27 +643,27 @@ var MindGraph = class {
|
|
|
637
643
|
}
|
|
638
644
|
/** Get a single wiki article by UID. */
|
|
639
645
|
async getArticle(uid) {
|
|
640
|
-
return this.get(`/wiki/article/${uid}`);
|
|
646
|
+
return this.get(`/wiki/article/${seg(uid)}`);
|
|
641
647
|
}
|
|
642
648
|
/** Find the article that covers or summarizes a given entity/document UID. */
|
|
643
649
|
async getArticleBySubject(subjectUid) {
|
|
644
650
|
try {
|
|
645
|
-
return await this.get(`/wiki/article/by-subject/${subjectUid}`);
|
|
651
|
+
return await this.get(`/wiki/article/by-subject/${seg(subjectUid)}`);
|
|
646
652
|
} catch {
|
|
647
653
|
return null;
|
|
648
654
|
}
|
|
649
655
|
}
|
|
650
656
|
/** Update an article's markdown content (user editing). */
|
|
651
657
|
async updateArticle(uid, content) {
|
|
652
|
-
return this.patch(`/wiki/article/${uid}`, { content });
|
|
658
|
+
return this.patch(`/wiki/article/${seg(uid)}`, { content });
|
|
653
659
|
}
|
|
654
660
|
/** Trigger wiki compilation for a specific document. */
|
|
655
661
|
async compileDocument(docUid) {
|
|
656
|
-
return this.post(`/wiki/compile/${docUid}`, {});
|
|
662
|
+
return this.post(`/wiki/compile/${seg(docUid)}`, {});
|
|
657
663
|
}
|
|
658
664
|
/** Trigger wiki compilation for a specific entity. */
|
|
659
665
|
async compileEntity(entityUid) {
|
|
660
|
-
return this.post(`/wiki/compile/entity/${entityUid}`, {});
|
|
666
|
+
return this.post(`/wiki/compile/entity/${seg(entityUid)}`, {});
|
|
661
667
|
}
|
|
662
668
|
/** Backfill: compile articles for all documents and eligible entities. */
|
|
663
669
|
async compileAll() {
|
|
@@ -678,7 +684,7 @@ var MindGraph = class {
|
|
|
678
684
|
if (opts?.signals) q.set("signals", opts.signals);
|
|
679
685
|
if (opts?.target_types) q.set("target_types", opts.target_types);
|
|
680
686
|
const qs = q.toString();
|
|
681
|
-
return this.get(`/synthesis/signals/${projectUid}${qs ? `?${qs}` : ""}`);
|
|
687
|
+
return this.get(`/synthesis/signals/${seg(projectUid)}${qs ? `?${qs}` : ""}`);
|
|
682
688
|
}
|
|
683
689
|
/**
|
|
684
690
|
* Spawn a background synthesis job for a project: mines signals,
|
|
@@ -688,7 +694,7 @@ var MindGraph = class {
|
|
|
688
694
|
* Returns a `job_id` immediately; poll `getJob(id)` for progress.
|
|
689
695
|
*/
|
|
690
696
|
async runSynthesis(projectUid) {
|
|
691
|
-
return this.post(`/synthesis/run/${projectUid}`, {});
|
|
697
|
+
return this.post(`/synthesis/run/${seg(projectUid)}`, {});
|
|
692
698
|
}
|
|
693
699
|
// ============================================================================
|
|
694
700
|
// Operational Ontology Layer (Layer 7)
|
|
@@ -698,22 +704,22 @@ var MindGraph = class {
|
|
|
698
704
|
return this.get("/v1/ontology/schemas");
|
|
699
705
|
}
|
|
700
706
|
async getOntologySchema(id) {
|
|
701
|
-
return this.get(`/v1/ontology/schemas/${id}`);
|
|
707
|
+
return this.get(`/v1/ontology/schemas/${seg(id)}`);
|
|
702
708
|
}
|
|
703
709
|
async createOntologySchema(req) {
|
|
704
710
|
return this.post("/v1/ontology/schemas", req);
|
|
705
711
|
}
|
|
706
712
|
async updateOntologySchema(id, req) {
|
|
707
|
-
return this.patch(`/v1/ontology/schemas/${id}`, req);
|
|
713
|
+
return this.patch(`/v1/ontology/schemas/${seg(id)}`, req);
|
|
708
714
|
}
|
|
709
715
|
async activateOntologySchema(id) {
|
|
710
|
-
return this.post(`/v1/ontology/schemas/${id}/activate`, {});
|
|
716
|
+
return this.post(`/v1/ontology/schemas/${seg(id)}/activate`, {});
|
|
711
717
|
}
|
|
712
718
|
async deprecateOntologySchema(id) {
|
|
713
|
-
return this.post(`/v1/ontology/schemas/${id}/deprecate`, {});
|
|
719
|
+
return this.post(`/v1/ontology/schemas/${seg(id)}/deprecate`, {});
|
|
714
720
|
}
|
|
715
721
|
async archiveOntologySchema(id) {
|
|
716
|
-
return this.del(`/v1/ontology/schemas/${id}`);
|
|
722
|
+
return this.del(`/v1/ontology/schemas/${seg(id)}`);
|
|
717
723
|
}
|
|
718
724
|
/**
|
|
719
725
|
* Kick off an LLM-driven schema proposal job.
|
|
@@ -724,47 +730,47 @@ var MindGraph = class {
|
|
|
724
730
|
return this.post("/v1/ontology/propose-schema", req);
|
|
725
731
|
}
|
|
726
732
|
async testOntologySchema(id, opts) {
|
|
727
|
-
return this.post(`/v1/ontology/schemas/${id}/test`, opts ?? {});
|
|
733
|
+
return this.post(`/v1/ontology/schemas/${seg(id)}/test`, opts ?? {});
|
|
728
734
|
}
|
|
729
735
|
// ---- Schema sub-resources ----
|
|
730
736
|
async addOntologyObjectType(schemaId, req) {
|
|
731
|
-
return this.post(`/v1/ontology/schemas/${schemaId}/object-types`, req);
|
|
737
|
+
return this.post(`/v1/ontology/schemas/${seg(schemaId)}/object-types`, req);
|
|
732
738
|
}
|
|
733
739
|
async updateOntologyObjectType(schemaId, typeId, req) {
|
|
734
740
|
return this.patch(
|
|
735
|
-
`/v1/ontology/schemas/${schemaId}/object-types/${typeId}`,
|
|
741
|
+
`/v1/ontology/schemas/${seg(schemaId)}/object-types/${seg(typeId)}`,
|
|
736
742
|
req
|
|
737
743
|
);
|
|
738
744
|
}
|
|
739
745
|
async deleteOntologyObjectType(schemaId, typeId) {
|
|
740
746
|
return this.del(
|
|
741
|
-
`/v1/ontology/schemas/${schemaId}/object-types/${typeId}`
|
|
747
|
+
`/v1/ontology/schemas/${seg(schemaId)}/object-types/${seg(typeId)}`
|
|
742
748
|
);
|
|
743
749
|
}
|
|
744
750
|
async addOntologyRelationType(schemaId, req) {
|
|
745
|
-
return this.post(`/v1/ontology/schemas/${schemaId}/relation-types`, req);
|
|
751
|
+
return this.post(`/v1/ontology/schemas/${seg(schemaId)}/relation-types`, req);
|
|
746
752
|
}
|
|
747
753
|
async updateOntologyRelationType(schemaId, typeId, req) {
|
|
748
754
|
return this.patch(
|
|
749
|
-
`/v1/ontology/schemas/${schemaId}/relation-types/${typeId}`,
|
|
755
|
+
`/v1/ontology/schemas/${seg(schemaId)}/relation-types/${seg(typeId)}`,
|
|
750
756
|
req
|
|
751
757
|
);
|
|
752
758
|
}
|
|
753
759
|
async deleteOntologyRelationType(schemaId, typeId) {
|
|
754
760
|
return this.del(
|
|
755
|
-
`/v1/ontology/schemas/${schemaId}/relation-types/${typeId}`
|
|
761
|
+
`/v1/ontology/schemas/${seg(schemaId)}/relation-types/${seg(typeId)}`
|
|
756
762
|
);
|
|
757
763
|
}
|
|
758
764
|
/** Generate inert semantic classifications for individual human review. */
|
|
759
765
|
async analyzeOntologySemanticGuidance(schemaId) {
|
|
760
766
|
return this.post(
|
|
761
|
-
`/v1/ontology/schemas/${schemaId}/semantic-guidance/analyze`,
|
|
767
|
+
`/v1/ontology/schemas/${seg(schemaId)}/semantic-guidance/analyze`,
|
|
762
768
|
{}
|
|
763
769
|
);
|
|
764
770
|
}
|
|
765
771
|
/** Read-only exact-identity collision audit; never merges graph data. */
|
|
766
772
|
async auditOntologyDuplicates(schemaId) {
|
|
767
|
-
return this.post(`/v1/ontology/schemas/${schemaId}/duplicates/audit`, {});
|
|
773
|
+
return this.post(`/v1/ontology/schemas/${seg(schemaId)}/duplicates/audit`, {});
|
|
768
774
|
}
|
|
769
775
|
// ---- Proposals ----
|
|
770
776
|
async listOntologyProposals(opts) {
|
|
@@ -780,19 +786,19 @@ var MindGraph = class {
|
|
|
780
786
|
return this.get(`/v1/ontology/proposals${qs ? `?${qs}` : ""}`);
|
|
781
787
|
}
|
|
782
788
|
async getOntologyProposal(id) {
|
|
783
|
-
return this.get(`/v1/ontology/proposals/${id}`);
|
|
789
|
+
return this.get(`/v1/ontology/proposals/${seg(id)}`);
|
|
784
790
|
}
|
|
785
791
|
async patchOntologyProposal(id, req) {
|
|
786
|
-
return this.patch(`/v1/ontology/proposals/${id}`, req);
|
|
792
|
+
return this.patch(`/v1/ontology/proposals/${seg(id)}`, req);
|
|
787
793
|
}
|
|
788
794
|
async approveOntologyProposal(id, opts) {
|
|
789
|
-
return this.post(`/v1/ontology/proposals/${id}/approve`, opts ?? {});
|
|
795
|
+
return this.post(`/v1/ontology/proposals/${seg(id)}/approve`, opts ?? {});
|
|
790
796
|
}
|
|
791
797
|
async rejectOntologyProposal(id, reason) {
|
|
792
|
-
return this.post(`/v1/ontology/proposals/${id}/reject`, { reason });
|
|
798
|
+
return this.post(`/v1/ontology/proposals/${seg(id)}/reject`, { reason });
|
|
793
799
|
}
|
|
794
800
|
async applyOntologyProposal(id) {
|
|
795
|
-
return this.post(`/v1/ontology/proposals/${id}/apply`, {});
|
|
801
|
+
return this.post(`/v1/ontology/proposals/${seg(id)}/apply`, {});
|
|
796
802
|
}
|
|
797
803
|
async batchApproveOntologyProposals(ids, feedback) {
|
|
798
804
|
return this.post("/v1/ontology/proposals/batch-approve", { ids, feedback });
|
|
@@ -841,7 +847,7 @@ var MindGraph = class {
|
|
|
841
847
|
if (binding.project_uid) query.set("project_uid", binding.project_uid);
|
|
842
848
|
}
|
|
843
849
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
844
|
-
return this.get(`/ontology/object/${uid}${suffix}`);
|
|
850
|
+
return this.get(`/ontology/object/${seg(uid)}${suffix}`);
|
|
845
851
|
}
|
|
846
852
|
async getDomainObjectContext(uid, depth, binding) {
|
|
847
853
|
const query = new URLSearchParams();
|
|
@@ -852,10 +858,10 @@ var MindGraph = class {
|
|
|
852
858
|
if (binding.project_uid) query.set("project_uid", binding.project_uid);
|
|
853
859
|
}
|
|
854
860
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
855
|
-
return this.get(`/ontology/object/${uid}/context${suffix}`);
|
|
861
|
+
return this.get(`/ontology/object/${seg(uid)}/context${suffix}`);
|
|
856
862
|
}
|
|
857
863
|
async getDomainObjectHistory(uid) {
|
|
858
|
-
return this.get(`/ontology/object/${uid}/history`);
|
|
864
|
+
return this.get(`/ontology/object/${seg(uid)}/history`);
|
|
859
865
|
}
|
|
860
866
|
async listDomainObjects(opts) {
|
|
861
867
|
const q = new URLSearchParams();
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// src/client.ts
|
|
2
|
+
function seg(value) {
|
|
3
|
+
return encodeURIComponent(String(value));
|
|
4
|
+
}
|
|
2
5
|
var MindGraphError = class extends Error {
|
|
3
6
|
constructor(message, status, body) {
|
|
4
7
|
super(message);
|
|
@@ -268,6 +271,9 @@ var MindGraph = class {
|
|
|
268
271
|
async memoryConfig(req) {
|
|
269
272
|
return this.post("/memory/config", req);
|
|
270
273
|
}
|
|
274
|
+
async memorySync(req) {
|
|
275
|
+
return this.post("/memory/sync", req);
|
|
276
|
+
}
|
|
271
277
|
// ---- Agent Layer ----
|
|
272
278
|
async plan(req) {
|
|
273
279
|
return this.post("/agent/plan", req);
|
|
@@ -291,7 +297,7 @@ var MindGraph = class {
|
|
|
291
297
|
}
|
|
292
298
|
// ---- Node CRUD ----
|
|
293
299
|
async getNode(uid) {
|
|
294
|
-
return this.get(`/node/${uid}`);
|
|
300
|
+
return this.get(`/node/${seg(uid)}`);
|
|
295
301
|
}
|
|
296
302
|
/**
|
|
297
303
|
* Create a node via the low-level CRUD endpoint.
|
|
@@ -308,10 +314,10 @@ var MindGraph = class {
|
|
|
308
314
|
return this.post("/node", { ...body, props });
|
|
309
315
|
}
|
|
310
316
|
async updateNode(uid, body) {
|
|
311
|
-
return this.patch(`/node/${uid}`, body);
|
|
317
|
+
return this.patch(`/node/${seg(uid)}`, body);
|
|
312
318
|
}
|
|
313
319
|
async deleteNode(uid) {
|
|
314
|
-
await this.del(`/node/${uid}`);
|
|
320
|
+
await this.del(`/node/${seg(uid)}`);
|
|
315
321
|
}
|
|
316
322
|
async batchDeleteNodes(params) {
|
|
317
323
|
const body = {};
|
|
@@ -332,10 +338,10 @@ var MindGraph = class {
|
|
|
332
338
|
return this.post("/nodes/delete", body);
|
|
333
339
|
}
|
|
334
340
|
async getNodeHistory(uid) {
|
|
335
|
-
return this.get(`/node/${uid}/history`);
|
|
341
|
+
return this.get(`/node/${seg(uid)}/history`);
|
|
336
342
|
}
|
|
337
343
|
async getNodeAtVersion(uid, version) {
|
|
338
|
-
return this.get(`/node/${uid}/history/${version}`);
|
|
344
|
+
return this.get(`/node/${seg(uid)}/history/${seg(version)}`);
|
|
339
345
|
}
|
|
340
346
|
// ---- Edge CRUD ----
|
|
341
347
|
async addLink(body) {
|
|
@@ -356,13 +362,13 @@ var MindGraph = class {
|
|
|
356
362
|
return this.post("/edge", { ...body, props });
|
|
357
363
|
}
|
|
358
364
|
async updateEdge(uid, body) {
|
|
359
|
-
return this.patch(`/edge/${uid}`, body);
|
|
365
|
+
return this.patch(`/edge/${seg(uid)}`, body);
|
|
360
366
|
}
|
|
361
367
|
async deleteEdge(uid) {
|
|
362
|
-
await this.del(`/edge/${uid}`);
|
|
368
|
+
await this.del(`/edge/${seg(uid)}`);
|
|
363
369
|
}
|
|
364
370
|
async getEdgeHistory(uid) {
|
|
365
|
-
return this.get(`/edge/${uid}/history`);
|
|
371
|
+
return this.get(`/edge/${seg(uid)}/history`);
|
|
366
372
|
}
|
|
367
373
|
/**
|
|
368
374
|
* List edges filtered by source and/or target node.
|
|
@@ -411,7 +417,7 @@ var MindGraph = class {
|
|
|
411
417
|
return this.get(`/nodes?${qs}`);
|
|
412
418
|
}
|
|
413
419
|
async getAgentNodes(agentId) {
|
|
414
|
-
return this.get(`/agent/${agentId}/nodes`);
|
|
420
|
+
return this.get(`/agent/${seg(agentId)}/nodes`);
|
|
415
421
|
}
|
|
416
422
|
// ---- Batch ----
|
|
417
423
|
async batch(req) {
|
|
@@ -436,13 +442,13 @@ var MindGraph = class {
|
|
|
436
442
|
return this.post("/embeddings/search-text", body);
|
|
437
443
|
}
|
|
438
444
|
async getEmbedding(uid) {
|
|
439
|
-
return this.get(`/node/${uid}/embedding`);
|
|
445
|
+
return this.get(`/node/${seg(uid)}/embedding`);
|
|
440
446
|
}
|
|
441
447
|
async setEmbedding(uid, vector) {
|
|
442
|
-
await this.request("PUT", `/node/${uid}/embedding`, { vector });
|
|
448
|
+
await this.request("PUT", `/node/${seg(uid)}/embedding`, { vector });
|
|
443
449
|
}
|
|
444
450
|
async deleteEmbedding(uid) {
|
|
445
|
-
await this.del(`/node/${uid}/embedding`);
|
|
451
|
+
await this.del(`/node/${seg(uid)}/embedding`);
|
|
446
452
|
}
|
|
447
453
|
// ---- Entity resolution ----
|
|
448
454
|
async mergeEntities(body) {
|
|
@@ -452,7 +458,7 @@ var MindGraph = class {
|
|
|
452
458
|
return this.post("/alias", body);
|
|
453
459
|
}
|
|
454
460
|
async getAliases(uid) {
|
|
455
|
-
return this.get(`/aliases/${uid}`);
|
|
461
|
+
return this.get(`/aliases/${seg(uid)}`);
|
|
456
462
|
}
|
|
457
463
|
async resolveAlias(text) {
|
|
458
464
|
return this.get(`/resolve?text=${encodeURIComponent(text)}`);
|
|
@@ -575,18 +581,18 @@ var MindGraph = class {
|
|
|
575
581
|
return this.get("/jobs");
|
|
576
582
|
}
|
|
577
583
|
async getJob(id) {
|
|
578
|
-
return this.get(`/jobs/${id}`);
|
|
584
|
+
return this.get(`/jobs/${seg(id)}`);
|
|
579
585
|
}
|
|
580
586
|
async cancelJob(id) {
|
|
581
|
-
return this.post(`/jobs/${id}/cancel`, {});
|
|
587
|
+
return this.post(`/jobs/${seg(id)}/cancel`, {});
|
|
582
588
|
}
|
|
583
589
|
/** Resume ingestion of a document that has failed chunks. */
|
|
584
590
|
async resumeDocument(docUid, opts) {
|
|
585
|
-
return this.post(`/ingest/resume/${docUid}`, opts ?? {});
|
|
591
|
+
return this.post(`/ingest/resume/${seg(docUid)}`, opts ?? {});
|
|
586
592
|
}
|
|
587
593
|
/** Delete a document and all its chunks and extracted nodes. */
|
|
588
594
|
async deleteDocument(uid) {
|
|
589
|
-
return this.del(`/ingest/document/${uid}`);
|
|
595
|
+
return this.del(`/ingest/document/${seg(uid)}`);
|
|
590
596
|
}
|
|
591
597
|
async cleanupOrphans() {
|
|
592
598
|
return this.post("/ingest/cleanup", {});
|
|
@@ -610,27 +616,27 @@ var MindGraph = class {
|
|
|
610
616
|
}
|
|
611
617
|
/** Get a single wiki article by UID. */
|
|
612
618
|
async getArticle(uid) {
|
|
613
|
-
return this.get(`/wiki/article/${uid}`);
|
|
619
|
+
return this.get(`/wiki/article/${seg(uid)}`);
|
|
614
620
|
}
|
|
615
621
|
/** Find the article that covers or summarizes a given entity/document UID. */
|
|
616
622
|
async getArticleBySubject(subjectUid) {
|
|
617
623
|
try {
|
|
618
|
-
return await this.get(`/wiki/article/by-subject/${subjectUid}`);
|
|
624
|
+
return await this.get(`/wiki/article/by-subject/${seg(subjectUid)}`);
|
|
619
625
|
} catch {
|
|
620
626
|
return null;
|
|
621
627
|
}
|
|
622
628
|
}
|
|
623
629
|
/** Update an article's markdown content (user editing). */
|
|
624
630
|
async updateArticle(uid, content) {
|
|
625
|
-
return this.patch(`/wiki/article/${uid}`, { content });
|
|
631
|
+
return this.patch(`/wiki/article/${seg(uid)}`, { content });
|
|
626
632
|
}
|
|
627
633
|
/** Trigger wiki compilation for a specific document. */
|
|
628
634
|
async compileDocument(docUid) {
|
|
629
|
-
return this.post(`/wiki/compile/${docUid}`, {});
|
|
635
|
+
return this.post(`/wiki/compile/${seg(docUid)}`, {});
|
|
630
636
|
}
|
|
631
637
|
/** Trigger wiki compilation for a specific entity. */
|
|
632
638
|
async compileEntity(entityUid) {
|
|
633
|
-
return this.post(`/wiki/compile/entity/${entityUid}`, {});
|
|
639
|
+
return this.post(`/wiki/compile/entity/${seg(entityUid)}`, {});
|
|
634
640
|
}
|
|
635
641
|
/** Backfill: compile articles for all documents and eligible entities. */
|
|
636
642
|
async compileAll() {
|
|
@@ -651,7 +657,7 @@ var MindGraph = class {
|
|
|
651
657
|
if (opts?.signals) q.set("signals", opts.signals);
|
|
652
658
|
if (opts?.target_types) q.set("target_types", opts.target_types);
|
|
653
659
|
const qs = q.toString();
|
|
654
|
-
return this.get(`/synthesis/signals/${projectUid}${qs ? `?${qs}` : ""}`);
|
|
660
|
+
return this.get(`/synthesis/signals/${seg(projectUid)}${qs ? `?${qs}` : ""}`);
|
|
655
661
|
}
|
|
656
662
|
/**
|
|
657
663
|
* Spawn a background synthesis job for a project: mines signals,
|
|
@@ -661,7 +667,7 @@ var MindGraph = class {
|
|
|
661
667
|
* Returns a `job_id` immediately; poll `getJob(id)` for progress.
|
|
662
668
|
*/
|
|
663
669
|
async runSynthesis(projectUid) {
|
|
664
|
-
return this.post(`/synthesis/run/${projectUid}`, {});
|
|
670
|
+
return this.post(`/synthesis/run/${seg(projectUid)}`, {});
|
|
665
671
|
}
|
|
666
672
|
// ============================================================================
|
|
667
673
|
// Operational Ontology Layer (Layer 7)
|
|
@@ -671,22 +677,22 @@ var MindGraph = class {
|
|
|
671
677
|
return this.get("/v1/ontology/schemas");
|
|
672
678
|
}
|
|
673
679
|
async getOntologySchema(id) {
|
|
674
|
-
return this.get(`/v1/ontology/schemas/${id}`);
|
|
680
|
+
return this.get(`/v1/ontology/schemas/${seg(id)}`);
|
|
675
681
|
}
|
|
676
682
|
async createOntologySchema(req) {
|
|
677
683
|
return this.post("/v1/ontology/schemas", req);
|
|
678
684
|
}
|
|
679
685
|
async updateOntologySchema(id, req) {
|
|
680
|
-
return this.patch(`/v1/ontology/schemas/${id}`, req);
|
|
686
|
+
return this.patch(`/v1/ontology/schemas/${seg(id)}`, req);
|
|
681
687
|
}
|
|
682
688
|
async activateOntologySchema(id) {
|
|
683
|
-
return this.post(`/v1/ontology/schemas/${id}/activate`, {});
|
|
689
|
+
return this.post(`/v1/ontology/schemas/${seg(id)}/activate`, {});
|
|
684
690
|
}
|
|
685
691
|
async deprecateOntologySchema(id) {
|
|
686
|
-
return this.post(`/v1/ontology/schemas/${id}/deprecate`, {});
|
|
692
|
+
return this.post(`/v1/ontology/schemas/${seg(id)}/deprecate`, {});
|
|
687
693
|
}
|
|
688
694
|
async archiveOntologySchema(id) {
|
|
689
|
-
return this.del(`/v1/ontology/schemas/${id}`);
|
|
695
|
+
return this.del(`/v1/ontology/schemas/${seg(id)}`);
|
|
690
696
|
}
|
|
691
697
|
/**
|
|
692
698
|
* Kick off an LLM-driven schema proposal job.
|
|
@@ -697,47 +703,47 @@ var MindGraph = class {
|
|
|
697
703
|
return this.post("/v1/ontology/propose-schema", req);
|
|
698
704
|
}
|
|
699
705
|
async testOntologySchema(id, opts) {
|
|
700
|
-
return this.post(`/v1/ontology/schemas/${id}/test`, opts ?? {});
|
|
706
|
+
return this.post(`/v1/ontology/schemas/${seg(id)}/test`, opts ?? {});
|
|
701
707
|
}
|
|
702
708
|
// ---- Schema sub-resources ----
|
|
703
709
|
async addOntologyObjectType(schemaId, req) {
|
|
704
|
-
return this.post(`/v1/ontology/schemas/${schemaId}/object-types`, req);
|
|
710
|
+
return this.post(`/v1/ontology/schemas/${seg(schemaId)}/object-types`, req);
|
|
705
711
|
}
|
|
706
712
|
async updateOntologyObjectType(schemaId, typeId, req) {
|
|
707
713
|
return this.patch(
|
|
708
|
-
`/v1/ontology/schemas/${schemaId}/object-types/${typeId}`,
|
|
714
|
+
`/v1/ontology/schemas/${seg(schemaId)}/object-types/${seg(typeId)}`,
|
|
709
715
|
req
|
|
710
716
|
);
|
|
711
717
|
}
|
|
712
718
|
async deleteOntologyObjectType(schemaId, typeId) {
|
|
713
719
|
return this.del(
|
|
714
|
-
`/v1/ontology/schemas/${schemaId}/object-types/${typeId}`
|
|
720
|
+
`/v1/ontology/schemas/${seg(schemaId)}/object-types/${seg(typeId)}`
|
|
715
721
|
);
|
|
716
722
|
}
|
|
717
723
|
async addOntologyRelationType(schemaId, req) {
|
|
718
|
-
return this.post(`/v1/ontology/schemas/${schemaId}/relation-types`, req);
|
|
724
|
+
return this.post(`/v1/ontology/schemas/${seg(schemaId)}/relation-types`, req);
|
|
719
725
|
}
|
|
720
726
|
async updateOntologyRelationType(schemaId, typeId, req) {
|
|
721
727
|
return this.patch(
|
|
722
|
-
`/v1/ontology/schemas/${schemaId}/relation-types/${typeId}`,
|
|
728
|
+
`/v1/ontology/schemas/${seg(schemaId)}/relation-types/${seg(typeId)}`,
|
|
723
729
|
req
|
|
724
730
|
);
|
|
725
731
|
}
|
|
726
732
|
async deleteOntologyRelationType(schemaId, typeId) {
|
|
727
733
|
return this.del(
|
|
728
|
-
`/v1/ontology/schemas/${schemaId}/relation-types/${typeId}`
|
|
734
|
+
`/v1/ontology/schemas/${seg(schemaId)}/relation-types/${seg(typeId)}`
|
|
729
735
|
);
|
|
730
736
|
}
|
|
731
737
|
/** Generate inert semantic classifications for individual human review. */
|
|
732
738
|
async analyzeOntologySemanticGuidance(schemaId) {
|
|
733
739
|
return this.post(
|
|
734
|
-
`/v1/ontology/schemas/${schemaId}/semantic-guidance/analyze`,
|
|
740
|
+
`/v1/ontology/schemas/${seg(schemaId)}/semantic-guidance/analyze`,
|
|
735
741
|
{}
|
|
736
742
|
);
|
|
737
743
|
}
|
|
738
744
|
/** Read-only exact-identity collision audit; never merges graph data. */
|
|
739
745
|
async auditOntologyDuplicates(schemaId) {
|
|
740
|
-
return this.post(`/v1/ontology/schemas/${schemaId}/duplicates/audit`, {});
|
|
746
|
+
return this.post(`/v1/ontology/schemas/${seg(schemaId)}/duplicates/audit`, {});
|
|
741
747
|
}
|
|
742
748
|
// ---- Proposals ----
|
|
743
749
|
async listOntologyProposals(opts) {
|
|
@@ -753,19 +759,19 @@ var MindGraph = class {
|
|
|
753
759
|
return this.get(`/v1/ontology/proposals${qs ? `?${qs}` : ""}`);
|
|
754
760
|
}
|
|
755
761
|
async getOntologyProposal(id) {
|
|
756
|
-
return this.get(`/v1/ontology/proposals/${id}`);
|
|
762
|
+
return this.get(`/v1/ontology/proposals/${seg(id)}`);
|
|
757
763
|
}
|
|
758
764
|
async patchOntologyProposal(id, req) {
|
|
759
|
-
return this.patch(`/v1/ontology/proposals/${id}`, req);
|
|
765
|
+
return this.patch(`/v1/ontology/proposals/${seg(id)}`, req);
|
|
760
766
|
}
|
|
761
767
|
async approveOntologyProposal(id, opts) {
|
|
762
|
-
return this.post(`/v1/ontology/proposals/${id}/approve`, opts ?? {});
|
|
768
|
+
return this.post(`/v1/ontology/proposals/${seg(id)}/approve`, opts ?? {});
|
|
763
769
|
}
|
|
764
770
|
async rejectOntologyProposal(id, reason) {
|
|
765
|
-
return this.post(`/v1/ontology/proposals/${id}/reject`, { reason });
|
|
771
|
+
return this.post(`/v1/ontology/proposals/${seg(id)}/reject`, { reason });
|
|
766
772
|
}
|
|
767
773
|
async applyOntologyProposal(id) {
|
|
768
|
-
return this.post(`/v1/ontology/proposals/${id}/apply`, {});
|
|
774
|
+
return this.post(`/v1/ontology/proposals/${seg(id)}/apply`, {});
|
|
769
775
|
}
|
|
770
776
|
async batchApproveOntologyProposals(ids, feedback) {
|
|
771
777
|
return this.post("/v1/ontology/proposals/batch-approve", { ids, feedback });
|
|
@@ -814,7 +820,7 @@ var MindGraph = class {
|
|
|
814
820
|
if (binding.project_uid) query.set("project_uid", binding.project_uid);
|
|
815
821
|
}
|
|
816
822
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
817
|
-
return this.get(`/ontology/object/${uid}${suffix}`);
|
|
823
|
+
return this.get(`/ontology/object/${seg(uid)}${suffix}`);
|
|
818
824
|
}
|
|
819
825
|
async getDomainObjectContext(uid, depth, binding) {
|
|
820
826
|
const query = new URLSearchParams();
|
|
@@ -825,10 +831,10 @@ var MindGraph = class {
|
|
|
825
831
|
if (binding.project_uid) query.set("project_uid", binding.project_uid);
|
|
826
832
|
}
|
|
827
833
|
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
828
|
-
return this.get(`/ontology/object/${uid}/context${suffix}`);
|
|
834
|
+
return this.get(`/ontology/object/${seg(uid)}/context${suffix}`);
|
|
829
835
|
}
|
|
830
836
|
async getDomainObjectHistory(uid) {
|
|
831
|
-
return this.get(`/ontology/object/${uid}/history`);
|
|
837
|
+
return this.get(`/ontology/object/${seg(uid)}/history`);
|
|
832
838
|
}
|
|
833
839
|
async listDomainObjects(opts) {
|
|
834
840
|
const q = new URLSearchParams();
|