@loxtep/sdk 0.9.6 → 0.9.8
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/CHANGELOG.md +43 -0
- package/README.md +4 -4
- package/dist/auth/browser-login.d.ts +2 -2
- package/dist/auth/browser-login.js +3 -3
- package/dist/cli/commands/approvals-cmd.d.ts +39 -9
- package/dist/cli/commands/approvals-cmd.d.ts.map +1 -1
- package/dist/cli/commands/approvals-cmd.js +112 -48
- package/dist/cli/commands/approvals-cmd.js.map +1 -1
- package/dist/cli/commands/candidates-cmd.d.ts +24 -0
- package/dist/cli/commands/candidates-cmd.d.ts.map +1 -0
- package/dist/cli/commands/candidates-cmd.js +138 -0
- package/dist/cli/commands/candidates-cmd.js.map +1 -0
- package/dist/cli/commands/cdlc-cmd.d.ts +23 -0
- package/dist/cli/commands/cdlc-cmd.d.ts.map +1 -0
- package/dist/cli/commands/cdlc-cmd.js +110 -0
- package/dist/cli/commands/cdlc-cmd.js.map +1 -0
- package/dist/cli/commands/packs-cmd.d.ts +14 -0
- package/dist/cli/commands/packs-cmd.d.ts.map +1 -0
- package/dist/cli/commands/packs-cmd.js +86 -0
- package/dist/cli/commands/packs-cmd.js.map +1 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +16 -2
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.js +143 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/client/agent-workspace-types.d.ts +74 -0
- package/dist/client/agent-workspace-types.d.ts.map +1 -0
- package/dist/client/agent-workspace-types.js +7 -0
- package/dist/client/agent-workspace-types.js.map +1 -0
- package/dist/client/agent-workspace.d.ts +45 -0
- package/dist/client/agent-workspace.d.ts.map +1 -0
- package/dist/client/agent-workspace.js +142 -0
- package/dist/client/agent-workspace.js.map +1 -0
- package/dist/client/approvals-types.d.ts +18 -0
- package/dist/client/approvals-types.d.ts.map +1 -1
- package/dist/client/approvals.d.ts +4 -4
- package/dist/client/approvals.d.ts.map +1 -1
- package/dist/client/approvals.js +31 -8
- package/dist/client/approvals.js.map +1 -1
- package/dist/client/cdlc-types.d.ts +147 -0
- package/dist/client/cdlc-types.d.ts.map +1 -0
- package/dist/client/cdlc-types.js +16 -0
- package/dist/client/cdlc-types.js.map +1 -0
- package/dist/client/cdlc.d.ts +27 -0
- package/dist/client/cdlc.d.ts.map +1 -0
- package/dist/client/cdlc.js +174 -0
- package/dist/client/cdlc.js.map +1 -0
- package/dist/client/context.d.ts +8 -1
- package/dist/client/context.d.ts.map +1 -1
- package/dist/client/context.js +4 -1
- package/dist/client/context.js.map +1 -1
- package/dist/client/index.d.ts +19 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/loxtep-client.d.ts +2 -2
- package/dist/client/loxtep-client.d.ts.map +1 -1
- package/dist/client/loxtep-client.js +42 -5
- package/dist/client/loxtep-client.js.map +1 -1
- package/dist/client/meaning.d.ts +10 -1
- package/dist/client/meaning.d.ts.map +1 -1
- package/dist/client/meaning.js +4 -1
- package/dist/client/meaning.js.map +1 -1
- package/dist/client/mining-types.d.ts +81 -0
- package/dist/client/mining-types.d.ts.map +1 -0
- package/dist/client/mining-types.js +14 -0
- package/dist/client/mining-types.js.map +1 -0
- package/dist/client/mining.d.ts +17 -0
- package/dist/client/mining.d.ts.map +1 -0
- package/dist/client/mining.js +115 -0
- package/dist/client/mining.js.map +1 -0
- package/dist/client/ontology-types.d.ts +91 -0
- package/dist/client/ontology-types.d.ts.map +1 -0
- package/dist/client/ontology-types.js +6 -0
- package/dist/client/ontology-types.js.map +1 -0
- package/dist/client/ontology.d.ts +27 -0
- package/dist/client/ontology.d.ts.map +1 -0
- package/dist/client/ontology.js +146 -0
- package/dist/client/ontology.js.map +1 -0
- package/dist/client/packs-types.d.ts +48 -0
- package/dist/client/packs-types.d.ts.map +1 -0
- package/dist/client/packs-types.js +7 -0
- package/dist/client/packs-types.js.map +1 -0
- package/dist/client/packs.d.ts +27 -0
- package/dist/client/packs.d.ts.map +1 -0
- package/dist/client/packs.js +122 -0
- package/dist/client/packs.js.map +1 -0
- package/dist/client/procedures-types.d.ts +147 -6
- package/dist/client/procedures-types.d.ts.map +1 -1
- package/dist/client/procedures-types.js +3 -2
- package/dist/client/procedures-types.js.map +1 -1
- package/dist/client/procedures.d.ts +27 -13
- package/dist/client/procedures.d.ts.map +1 -1
- package/dist/client/procedures.js +180 -20
- package/dist/client/procedures.js.map +1 -1
- package/dist/client/process-intelligence-types.d.ts +94 -2
- package/dist/client/process-intelligence-types.d.ts.map +1 -1
- package/dist/client/process-intelligence-types.js +15 -3
- package/dist/client/process-intelligence-types.js.map +1 -1
- package/dist/client/process-intelligence.d.ts +18 -5
- package/dist/client/process-intelligence.d.ts.map +1 -1
- package/dist/client/process-intelligence.js +47 -5
- package/dist/client/process-intelligence.js.map +1 -1
- package/dist/client/review.d.ts +7 -1
- package/dist/client/review.d.ts.map +1 -1
- package/dist/client/review.js +3 -1
- package/dist/client/review.js.map +1 -1
- package/dist/client/semantic-layer-types.d.ts +65 -0
- package/dist/client/semantic-layer-types.d.ts.map +1 -0
- package/dist/client/semantic-layer-types.js +7 -0
- package/dist/client/semantic-layer-types.js.map +1 -0
- package/dist/client/semantic-layer.d.ts +25 -0
- package/dist/client/semantic-layer.d.ts.map +1 -0
- package/dist/client/semantic-layer.js +100 -0
- package/dist/client/semantic-layer.js.map +1 -0
- package/docs/sdk-mcp-mapping.md +157 -3
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context mining API types (MCP: loxtep_review mining ops).
|
|
3
|
+
* MCP ops: run_mining_pass, list_candidates, act_on_candidate.
|
|
4
|
+
*
|
|
5
|
+
* REST (graph):
|
|
6
|
+
* POST /graph/organizations/{org}/mining/run
|
|
7
|
+
* GET /graph/organizations/{org}/mining/candidates
|
|
8
|
+
* POST /graph/organizations/{org}/mining/candidates/{candidate_id}/act
|
|
9
|
+
*
|
|
10
|
+
* Invariant: mining only surfaces candidates — never auto-commits.
|
|
11
|
+
* act_on_candidate(approve) routes through CDLC at `in_review`.
|
|
12
|
+
*/
|
|
13
|
+
export interface MiningApiDeps {
|
|
14
|
+
/** Default organization for mining calls; overridable per call. */
|
|
15
|
+
organization_id?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Signal sources the mining pass can analyze. */
|
|
18
|
+
export type MiningSignalSource = 'semantic_definitions' | 'decision_traces' | 'event_sequences' | (string & {});
|
|
19
|
+
export type MiningCandidateType = 'semantic_conflict' | 'procedure' | 'promotion' | 'entity_fact' | (string & {});
|
|
20
|
+
export type MiningCandidateStatus = 'candidate' | 'approved' | 'rejected' | (string & {});
|
|
21
|
+
export type MiningCandidateAction = 'approve' | 'reject';
|
|
22
|
+
export interface MiningScopeFilters {
|
|
23
|
+
entity_types?: string[];
|
|
24
|
+
from_date?: string;
|
|
25
|
+
to_date?: string;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface RunMiningPassInput {
|
|
29
|
+
organization_id?: string;
|
|
30
|
+
/** Signal sources to mine (optional — platform defaults to all). */
|
|
31
|
+
signal_sources?: MiningSignalSource[] | null;
|
|
32
|
+
/** Scope filters to narrow the mining pass (optional). */
|
|
33
|
+
scope_filters?: MiningScopeFilters | null;
|
|
34
|
+
}
|
|
35
|
+
/** Platform payload for a mining pass; shape may grow — keep index signature. */
|
|
36
|
+
export interface RunMiningPassResult {
|
|
37
|
+
mining_run_id?: string;
|
|
38
|
+
candidates?: MiningCandidate[];
|
|
39
|
+
candidate_ids?: string[];
|
|
40
|
+
candidates_created?: number;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
export interface ListCandidatesFilters {
|
|
44
|
+
organization_id?: string;
|
|
45
|
+
candidate_type?: MiningCandidateType;
|
|
46
|
+
status?: MiningCandidateStatus;
|
|
47
|
+
mining_run_id?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface MiningCandidate {
|
|
50
|
+
id: string;
|
|
51
|
+
candidate_type: MiningCandidateType;
|
|
52
|
+
status: MiningCandidateStatus;
|
|
53
|
+
payload: Record<string, unknown>;
|
|
54
|
+
provenance_refs: string[];
|
|
55
|
+
mining_run_id: string | null;
|
|
56
|
+
organization_id: string;
|
|
57
|
+
created_at?: string;
|
|
58
|
+
resolved_at?: string | null;
|
|
59
|
+
resolved_by?: string | null;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
export interface ListCandidatesResult {
|
|
63
|
+
candidates: MiningCandidate[];
|
|
64
|
+
total: number;
|
|
65
|
+
}
|
|
66
|
+
export interface ActOnCandidateInput {
|
|
67
|
+
candidate_id: string;
|
|
68
|
+
action: MiningCandidateAction;
|
|
69
|
+
organization_id?: string;
|
|
70
|
+
rationale?: string;
|
|
71
|
+
/** Optional actor identity; platform may default from auth context. */
|
|
72
|
+
actor?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ActOnCandidateResult {
|
|
75
|
+
candidate_id?: string;
|
|
76
|
+
action?: MiningCandidateAction | string;
|
|
77
|
+
status?: MiningCandidateStatus | string;
|
|
78
|
+
artifact_ref?: string;
|
|
79
|
+
[key: string]: unknown;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=mining-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mining-types.d.ts","sourceRoot":"","sources":["../../src/client/mining-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,kDAAkD;AAClD,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,iBAAiB,GACjB,iBAAiB,GACjB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAC3B,mBAAmB,GACnB,WAAW,GACX,WAAW,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C;IACjC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;IACxC,MAAM,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context mining API types (MCP: loxtep_review mining ops).
|
|
3
|
+
* MCP ops: run_mining_pass, list_candidates, act_on_candidate.
|
|
4
|
+
*
|
|
5
|
+
* REST (graph):
|
|
6
|
+
* POST /graph/organizations/{org}/mining/run
|
|
7
|
+
* GET /graph/organizations/{org}/mining/candidates
|
|
8
|
+
* POST /graph/organizations/{org}/mining/candidates/{candidate_id}/act
|
|
9
|
+
*
|
|
10
|
+
* Invariant: mining only surfaces candidates — never auto-commits.
|
|
11
|
+
* act_on_candidate(approve) routes through CDLC at `in_review`.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=mining-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mining-types.js","sourceRoot":"","sources":["../../src/client/mining-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context mining API (MCP: loxtep_review — run_mining_pass, list_candidates, act_on_candidate).
|
|
3
|
+
*
|
|
4
|
+
* REST:
|
|
5
|
+
* POST /graph/organizations/{org}/mining/run
|
|
6
|
+
* GET /graph/organizations/{org}/mining/candidates
|
|
7
|
+
* POST /graph/organizations/{org}/mining/candidates/{candidate_id}/act
|
|
8
|
+
*/
|
|
9
|
+
import type { LoxtepHttpClient } from '../http/client.js';
|
|
10
|
+
import type { ActOnCandidateInput, ActOnCandidateResult, ListCandidatesFilters, ListCandidatesResult, MiningApiDeps, RunMiningPassInput, RunMiningPassResult } from './mining-types.js';
|
|
11
|
+
export interface MiningApi {
|
|
12
|
+
run_mining_pass: (input?: RunMiningPassInput) => Promise<RunMiningPassResult>;
|
|
13
|
+
list_candidates: (filters?: ListCandidatesFilters) => Promise<ListCandidatesResult>;
|
|
14
|
+
act_on_candidate: (input: ActOnCandidateInput) => Promise<ActOnCandidateResult>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createMiningApi(http: LoxtepHttpClient, deps?: MiningApiDeps): MiningApi;
|
|
17
|
+
//# sourceMappingURL=mining.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mining.d.ts","sourceRoot":"","sources":["../../src/client/mining.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EAEb,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AA2E3B,MAAM,WAAW,SAAS;IACxB,eAAe,EAAE,CAAC,KAAK,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9E,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACpF,gBAAgB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACjF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,GAAE,aAAkB,GAAG,SAAS,CA2C3F"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context mining API (MCP: loxtep_review — run_mining_pass, list_candidates, act_on_candidate).
|
|
3
|
+
*
|
|
4
|
+
* REST:
|
|
5
|
+
* POST /graph/organizations/{org}/mining/run
|
|
6
|
+
* GET /graph/organizations/{org}/mining/candidates
|
|
7
|
+
* POST /graph/organizations/{org}/mining/candidates/{candidate_id}/act
|
|
8
|
+
*/
|
|
9
|
+
function unwrapData(res) {
|
|
10
|
+
return (res.data ?? res);
|
|
11
|
+
}
|
|
12
|
+
function requireOrg(deps, override) {
|
|
13
|
+
const org = override ?? deps.organization_id;
|
|
14
|
+
if (!org) {
|
|
15
|
+
throw new Error('organization_id is required for mining calls (set it on the client or pass it explicitly)');
|
|
16
|
+
}
|
|
17
|
+
return org;
|
|
18
|
+
}
|
|
19
|
+
function orgBase(org) {
|
|
20
|
+
return `/graph/organizations/${encodeURIComponent(org)}/mining`;
|
|
21
|
+
}
|
|
22
|
+
function asRecord(value) {
|
|
23
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
24
|
+
? value
|
|
25
|
+
: null;
|
|
26
|
+
}
|
|
27
|
+
function normalizeCandidate(row) {
|
|
28
|
+
const provenance = row.provenance_refs ?? row.provenanceRefs;
|
|
29
|
+
return {
|
|
30
|
+
...row,
|
|
31
|
+
id: String(row.id ?? row.candidate_id ?? row.candidateId ?? ''),
|
|
32
|
+
candidate_type: String(row.candidate_type ?? row.candidateType ?? 'unknown'),
|
|
33
|
+
status: String(row.status ?? 'candidate'),
|
|
34
|
+
payload: (asRecord(row.payload) ?? {}),
|
|
35
|
+
provenance_refs: Array.isArray(provenance)
|
|
36
|
+
? provenance.map(String)
|
|
37
|
+
: [],
|
|
38
|
+
mining_run_id: row.mining_run_id ??
|
|
39
|
+
row.miningRunId ??
|
|
40
|
+
null,
|
|
41
|
+
organization_id: String(row.organization_id ?? row.organizationId ?? ''),
|
|
42
|
+
created_at: row.created_at ??
|
|
43
|
+
row.createdAt,
|
|
44
|
+
resolved_at: row.resolved_at ??
|
|
45
|
+
row.resolvedAt ??
|
|
46
|
+
null,
|
|
47
|
+
resolved_by: row.resolved_by ??
|
|
48
|
+
row.resolvedBy ??
|
|
49
|
+
null,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function normalizeCandidates(payload) {
|
|
53
|
+
const obj = asRecord(payload);
|
|
54
|
+
let rows = [];
|
|
55
|
+
if (Array.isArray(payload)) {
|
|
56
|
+
rows = payload;
|
|
57
|
+
}
|
|
58
|
+
else if (obj) {
|
|
59
|
+
if (Array.isArray(obj.candidates))
|
|
60
|
+
rows = obj.candidates;
|
|
61
|
+
else if (Array.isArray(obj.items))
|
|
62
|
+
rows = obj.items;
|
|
63
|
+
}
|
|
64
|
+
const candidates = rows
|
|
65
|
+
.filter((r) => !!r && typeof r === 'object')
|
|
66
|
+
.map(normalizeCandidate);
|
|
67
|
+
const total = typeof obj?.total === 'number' ? obj.total : candidates.length;
|
|
68
|
+
return { candidates, total };
|
|
69
|
+
}
|
|
70
|
+
export function createMiningApi(http, deps = {}) {
|
|
71
|
+
return {
|
|
72
|
+
async run_mining_pass(input = {}) {
|
|
73
|
+
const org = requireOrg(deps, input.organization_id);
|
|
74
|
+
const path = `${orgBase(org)}/run`;
|
|
75
|
+
const res = await http.post(path, {
|
|
76
|
+
signal_sources: input.signal_sources ?? null,
|
|
77
|
+
scope_filters: input.scope_filters ?? null,
|
|
78
|
+
});
|
|
79
|
+
const payload = unwrapData(res) ?? {};
|
|
80
|
+
return payload;
|
|
81
|
+
},
|
|
82
|
+
async list_candidates(filters = {}) {
|
|
83
|
+
const org = requireOrg(deps, filters.organization_id);
|
|
84
|
+
const search = new URLSearchParams();
|
|
85
|
+
if (filters.candidate_type)
|
|
86
|
+
search.set('candidate_type', filters.candidate_type);
|
|
87
|
+
if (filters.status)
|
|
88
|
+
search.set('status', filters.status);
|
|
89
|
+
if (filters.mining_run_id)
|
|
90
|
+
search.set('mining_run_id', filters.mining_run_id);
|
|
91
|
+
const qs = search.toString() ? `?${search.toString()}` : '';
|
|
92
|
+
const res = await http.get(`${orgBase(org)}/candidates${qs}`);
|
|
93
|
+
return normalizeCandidates(unwrapData(res));
|
|
94
|
+
},
|
|
95
|
+
async act_on_candidate(input) {
|
|
96
|
+
const org = requireOrg(deps, input.organization_id);
|
|
97
|
+
if (!input.candidate_id) {
|
|
98
|
+
throw new Error('candidate_id is required for act_on_candidate');
|
|
99
|
+
}
|
|
100
|
+
const path = `${orgBase(org)}/candidates/${encodeURIComponent(input.candidate_id)}/act`;
|
|
101
|
+
const res = await http.post(path, {
|
|
102
|
+
action: input.action,
|
|
103
|
+
...(input.rationale != null ? { rationale: input.rationale } : {}),
|
|
104
|
+
...(input.actor != null ? { actor: input.actor } : {}),
|
|
105
|
+
});
|
|
106
|
+
const payload = unwrapData(res) ?? {};
|
|
107
|
+
return {
|
|
108
|
+
candidate_id: payload.candidate_id ?? input.candidate_id,
|
|
109
|
+
action: payload.action ?? input.action,
|
|
110
|
+
...payload,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=mining.js.map
|
|
@@ -0,0 +1 @@
|
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ACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ontology concepts + relationships types (LOX-1241).
|
|
3
|
+
* Backend: /graph/organizations/:organization_id/ontology/{concepts,relationships}
|
|
4
|
+
*/
|
|
5
|
+
export type OntologyNodeType = 'entity' | 'microservice' | 'taxonomy' | 'pattern' | 'custom';
|
|
6
|
+
export interface OntologyApiDeps {
|
|
7
|
+
organization_id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface OntologyConcept {
|
|
10
|
+
concept_id: string;
|
|
11
|
+
organization_id?: string;
|
|
12
|
+
name: string;
|
|
13
|
+
namespace: string;
|
|
14
|
+
node_type: OntologyNodeType | string;
|
|
15
|
+
description?: string;
|
|
16
|
+
uri?: string;
|
|
17
|
+
parent_concepts?: string[];
|
|
18
|
+
created_at?: string;
|
|
19
|
+
updated_at?: string;
|
|
20
|
+
tombstoned_at?: string;
|
|
21
|
+
lifecycle_state?: string | null;
|
|
22
|
+
change_propagation_policy?: string | null;
|
|
23
|
+
owner?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface OntologyConceptListResult {
|
|
26
|
+
concepts: OntologyConcept[];
|
|
27
|
+
total: number;
|
|
28
|
+
}
|
|
29
|
+
export interface OntologyListConceptsFilters {
|
|
30
|
+
organization_id?: string;
|
|
31
|
+
namespace?: string;
|
|
32
|
+
node_type?: OntologyNodeType | string;
|
|
33
|
+
}
|
|
34
|
+
export interface OntologyCreateConceptInput {
|
|
35
|
+
name: string;
|
|
36
|
+
namespace: string;
|
|
37
|
+
node_type: OntologyNodeType;
|
|
38
|
+
description?: string;
|
|
39
|
+
uri?: string;
|
|
40
|
+
parent_concepts?: string[];
|
|
41
|
+
organization_id?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface OntologyUpdateConceptInput {
|
|
44
|
+
description?: string;
|
|
45
|
+
namespace?: string;
|
|
46
|
+
node_type?: OntologyNodeType;
|
|
47
|
+
uri?: string;
|
|
48
|
+
organization_id?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface OntologyDeleteConceptResult {
|
|
51
|
+
concept: OntologyConcept;
|
|
52
|
+
warnings?: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface OntologyRelationship {
|
|
55
|
+
relationship_id?: string;
|
|
56
|
+
organization_id?: string;
|
|
57
|
+
source_entity_type: string;
|
|
58
|
+
target_entity_type: string;
|
|
59
|
+
relation_type: string;
|
|
60
|
+
relation_uri?: string;
|
|
61
|
+
join_field?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
created_at?: string;
|
|
64
|
+
source?: 'registry' | 'discovered' | 'authored' | 'merged';
|
|
65
|
+
confidence?: number;
|
|
66
|
+
namespace?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface OntologyRelationshipsResult {
|
|
69
|
+
relationships: OntologyRelationship[];
|
|
70
|
+
total: number;
|
|
71
|
+
source?: 'registry' | 'discovered' | 'merged';
|
|
72
|
+
}
|
|
73
|
+
export interface OntologyCreateRelationshipInput {
|
|
74
|
+
source_entity_type: string;
|
|
75
|
+
target_entity_type: string;
|
|
76
|
+
relation_type: string;
|
|
77
|
+
relation_uri?: string;
|
|
78
|
+
join_field?: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
organization_id?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface OntologyGetRelationshipsFilters {
|
|
83
|
+
organization_id?: string;
|
|
84
|
+
include_discovered?: boolean;
|
|
85
|
+
limit?: number;
|
|
86
|
+
source_entity_type?: string;
|
|
87
|
+
target_entity_type?: string;
|
|
88
|
+
relation_type?: string;
|
|
89
|
+
namespace?: string;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=ontology-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology-types.d.ts","sourceRoot":"","sources":["../../src/client/ontology-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GACxB,QAAQ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CAC1B;AAED,MAAM,WAAW,+BAA+B;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology-types.js","sourceRoot":"","sources":["../../src/client/ontology-types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ontology API (LOX-1241). Concepts CRUD + relationships create/list.
|
|
3
|
+
* MCP: loxtep_meaning ontology_* ops.
|
|
4
|
+
*
|
|
5
|
+
* GET /graph/organizations/{org}/ontology/concepts
|
|
6
|
+
* GET /graph/organizations/{org}/ontology/concepts/{concept_id}
|
|
7
|
+
* POST /graph/organizations/{org}/ontology/concepts
|
|
8
|
+
* PUT /graph/organizations/{org}/ontology/concepts/{concept_id}
|
|
9
|
+
* DELETE /graph/organizations/{org}/ontology/concepts/{concept_id}
|
|
10
|
+
* GET /graph/organizations/{org}/ontology/relationships
|
|
11
|
+
* POST /graph/organizations/{org}/ontology/relationships
|
|
12
|
+
*/
|
|
13
|
+
import type { LoxtepHttpClient } from '../http/client.js';
|
|
14
|
+
import type { OntologyApiDeps, OntologyConcept, OntologyConceptListResult, OntologyCreateConceptInput, OntologyCreateRelationshipInput, OntologyDeleteConceptResult, OntologyGetRelationshipsFilters, OntologyListConceptsFilters, OntologyRelationship, OntologyRelationshipsResult, OntologyUpdateConceptInput } from './ontology-types.js';
|
|
15
|
+
export declare function createOntologyApi(http: LoxtepHttpClient, deps?: OntologyApiDeps): {
|
|
16
|
+
list_concepts: (filters?: OntologyListConceptsFilters) => Promise<OntologyConceptListResult>;
|
|
17
|
+
get_concept: (concept_id: string, organization_id?: string) => Promise<OntologyConcept>;
|
|
18
|
+
create_concept: (input: OntologyCreateConceptInput) => Promise<OntologyConcept>;
|
|
19
|
+
update_concept: (concept_id: string, input: OntologyUpdateConceptInput) => Promise<OntologyConcept>;
|
|
20
|
+
delete_concept: (concept_id: string, organization_id?: string) => Promise<OntologyDeleteConceptResult>;
|
|
21
|
+
create_relationship: (input: OntologyCreateRelationshipInput) => Promise<OntologyRelationship>;
|
|
22
|
+
get_relationships: (filters?: OntologyGetRelationshipsFilters) => Promise<OntologyRelationshipsResult>;
|
|
23
|
+
/** Alias for get_relationships (GA meaning hub list path). */
|
|
24
|
+
list_relationships: (filters?: OntologyGetRelationshipsFilters) => Promise<OntologyRelationshipsResult>;
|
|
25
|
+
};
|
|
26
|
+
export type OntologyApi = ReturnType<typeof createOntologyApi>;
|
|
27
|
+
//# sourceMappingURL=ontology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology.d.ts","sourceRoot":"","sources":["../../src/client/ontology.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,EAC/B,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAwB7B,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,IAAI,GAAE,eAAoB,GACzB;IACD,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,2BAA2B,KAAK,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC7F,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACxF,cAAc,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAChF,cAAc,EAAE,CACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,0BAA0B,KAC9B,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9B,cAAc,EAAE,CACd,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,KACrB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC1C,mBAAmB,EAAE,CACnB,KAAK,EAAE,+BAA+B,KACnC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC,iBAAiB,EAAE,CACjB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC1C,8DAA8D;IAC9D,kBAAkB,EAAE,CAClB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC3C,CAwIA;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ontology API (LOX-1241). Concepts CRUD + relationships create/list.
|
|
3
|
+
* MCP: loxtep_meaning ontology_* ops.
|
|
4
|
+
*
|
|
5
|
+
* GET /graph/organizations/{org}/ontology/concepts
|
|
6
|
+
* GET /graph/organizations/{org}/ontology/concepts/{concept_id}
|
|
7
|
+
* POST /graph/organizations/{org}/ontology/concepts
|
|
8
|
+
* PUT /graph/organizations/{org}/ontology/concepts/{concept_id}
|
|
9
|
+
* DELETE /graph/organizations/{org}/ontology/concepts/{concept_id}
|
|
10
|
+
* GET /graph/organizations/{org}/ontology/relationships
|
|
11
|
+
* POST /graph/organizations/{org}/ontology/relationships
|
|
12
|
+
*/
|
|
13
|
+
function unwrapData(res) {
|
|
14
|
+
return (res.data ?? res);
|
|
15
|
+
}
|
|
16
|
+
function requireOrg(deps, override) {
|
|
17
|
+
const org = override ?? deps.organization_id;
|
|
18
|
+
if (!org) {
|
|
19
|
+
throw new Error('organization_id is required for ontology calls (set it on the client or pass it explicitly)');
|
|
20
|
+
}
|
|
21
|
+
return org;
|
|
22
|
+
}
|
|
23
|
+
function conceptsBase(org) {
|
|
24
|
+
return `/graph/organizations/${encodeURIComponent(org)}/ontology/concepts`;
|
|
25
|
+
}
|
|
26
|
+
function relationshipsBase(org) {
|
|
27
|
+
return `/graph/organizations/${encodeURIComponent(org)}/ontology/relationships`;
|
|
28
|
+
}
|
|
29
|
+
export function createOntologyApi(http, deps = {}) {
|
|
30
|
+
const api = {
|
|
31
|
+
async list_concepts(filters = {}) {
|
|
32
|
+
const org = requireOrg(deps, filters.organization_id);
|
|
33
|
+
const search = new URLSearchParams();
|
|
34
|
+
if (filters.namespace)
|
|
35
|
+
search.set('namespace', filters.namespace);
|
|
36
|
+
if (filters.node_type)
|
|
37
|
+
search.set('node_type', String(filters.node_type));
|
|
38
|
+
const qs = search.toString();
|
|
39
|
+
const res = await http.get(`${conceptsBase(org)}${qs ? `?${qs}` : ''}`);
|
|
40
|
+
const data = unwrapData(res);
|
|
41
|
+
if (Array.isArray(data)) {
|
|
42
|
+
return { concepts: data, total: data.length };
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
concepts: data?.concepts ?? [],
|
|
46
|
+
total: data?.total ?? data?.concepts?.length ?? 0,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
async get_concept(concept_id, organization_id) {
|
|
50
|
+
if (!concept_id)
|
|
51
|
+
throw new Error('concept_id is required');
|
|
52
|
+
const org = requireOrg(deps, organization_id);
|
|
53
|
+
const res = await http.get(`${conceptsBase(org)}/${encodeURIComponent(concept_id)}`);
|
|
54
|
+
return unwrapData(res);
|
|
55
|
+
},
|
|
56
|
+
async create_concept(input) {
|
|
57
|
+
const org = requireOrg(deps, input.organization_id);
|
|
58
|
+
const body = {
|
|
59
|
+
name: input.name,
|
|
60
|
+
namespace: input.namespace,
|
|
61
|
+
node_type: input.node_type,
|
|
62
|
+
description: input.description,
|
|
63
|
+
uri: input.uri,
|
|
64
|
+
parent_concepts: input.parent_concepts,
|
|
65
|
+
};
|
|
66
|
+
const res = await http.post(conceptsBase(org), body);
|
|
67
|
+
return unwrapData(res);
|
|
68
|
+
},
|
|
69
|
+
async update_concept(concept_id, input) {
|
|
70
|
+
if (!concept_id)
|
|
71
|
+
throw new Error('concept_id is required');
|
|
72
|
+
const org = requireOrg(deps, input.organization_id);
|
|
73
|
+
const body = {};
|
|
74
|
+
if (input.description !== undefined)
|
|
75
|
+
body.description = input.description;
|
|
76
|
+
if (input.namespace !== undefined)
|
|
77
|
+
body.namespace = input.namespace;
|
|
78
|
+
if (input.node_type !== undefined)
|
|
79
|
+
body.node_type = input.node_type;
|
|
80
|
+
if (input.uri !== undefined)
|
|
81
|
+
body.uri = input.uri;
|
|
82
|
+
const res = await http.put(`${conceptsBase(org)}/${encodeURIComponent(concept_id)}`, body);
|
|
83
|
+
return unwrapData(res);
|
|
84
|
+
},
|
|
85
|
+
async delete_concept(concept_id, organization_id) {
|
|
86
|
+
if (!concept_id)
|
|
87
|
+
throw new Error('concept_id is required');
|
|
88
|
+
const org = requireOrg(deps, organization_id);
|
|
89
|
+
const res = await http.delete(`${conceptsBase(org)}/${encodeURIComponent(concept_id)}`);
|
|
90
|
+
const envelope = res;
|
|
91
|
+
const concept = unwrapData(res);
|
|
92
|
+
return {
|
|
93
|
+
concept,
|
|
94
|
+
warnings: envelope.warnings,
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
async create_relationship(input) {
|
|
98
|
+
const org = requireOrg(deps, input.organization_id);
|
|
99
|
+
const body = {
|
|
100
|
+
source_entity_type: input.source_entity_type,
|
|
101
|
+
target_entity_type: input.target_entity_type,
|
|
102
|
+
relation_type: input.relation_type,
|
|
103
|
+
relation_uri: input.relation_uri,
|
|
104
|
+
join_field: input.join_field,
|
|
105
|
+
description: input.description,
|
|
106
|
+
};
|
|
107
|
+
const res = await http.post(relationshipsBase(org), body);
|
|
108
|
+
return unwrapData(res);
|
|
109
|
+
},
|
|
110
|
+
async get_relationships(filters = {}) {
|
|
111
|
+
const org = requireOrg(deps, filters.organization_id);
|
|
112
|
+
const search = new URLSearchParams();
|
|
113
|
+
if (filters.include_discovered !== undefined) {
|
|
114
|
+
search.set('include_discovered', filters.include_discovered ? 'true' : 'false');
|
|
115
|
+
}
|
|
116
|
+
if (filters.limit !== undefined)
|
|
117
|
+
search.set('limit', String(filters.limit));
|
|
118
|
+
if (filters.source_entity_type) {
|
|
119
|
+
search.set('source_entity_type', filters.source_entity_type);
|
|
120
|
+
}
|
|
121
|
+
if (filters.target_entity_type) {
|
|
122
|
+
search.set('target_entity_type', filters.target_entity_type);
|
|
123
|
+
}
|
|
124
|
+
if (filters.relation_type)
|
|
125
|
+
search.set('relation_type', filters.relation_type);
|
|
126
|
+
if (filters.namespace)
|
|
127
|
+
search.set('namespace', filters.namespace);
|
|
128
|
+
const qs = search.toString();
|
|
129
|
+
const res = await http.get(`${relationshipsBase(org)}${qs ? `?${qs}` : ''}`);
|
|
130
|
+
const data = unwrapData(res);
|
|
131
|
+
if (Array.isArray(data)) {
|
|
132
|
+
return { relationships: data, total: data.length };
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
relationships: data?.relationships ?? [],
|
|
136
|
+
total: data?.total ?? data?.relationships?.length ?? 0,
|
|
137
|
+
source: data?.source,
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
list_relationships(filters) {
|
|
141
|
+
return api.get_relationships(filters);
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
return api;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=ontology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology.js","sourceRoot":"","sources":["../../src/client/ontology.ts"],"names":[],"mappings":"AAAA;;;;;;;;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AAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vocabulary pack lifecycle types (LOX-1242).
|
|
3
|
+
* MCP: list_available_packs / activate_vocabulary_pack / get_pack_activation_status
|
|
4
|
+
* under loxtep_meaning (semantic-layer), not loxtep_define.
|
|
5
|
+
*/
|
|
6
|
+
export type PackActivationState = 'no_pack_active' | 'activating' | 'pack_active';
|
|
7
|
+
export interface PackActivationStatus {
|
|
8
|
+
activation_state: PackActivationState;
|
|
9
|
+
active_pack_id: string | null;
|
|
10
|
+
active_pack_version: string | null;
|
|
11
|
+
active_pack_display_name: string | null;
|
|
12
|
+
enabled_at: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface AvailablePackSummary {
|
|
15
|
+
pack_id: string;
|
|
16
|
+
display_name: string;
|
|
17
|
+
term_count?: number;
|
|
18
|
+
version?: string;
|
|
19
|
+
industry_relevance?: string;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Shape documented for MCP `list_available_packs`
|
|
24
|
+
* (GET /graph/admin/vocabulary-packs/recommend).
|
|
25
|
+
*/
|
|
26
|
+
export interface ListAvailablePacksResult {
|
|
27
|
+
recommended_pack_id?: string | null;
|
|
28
|
+
confidence?: 'high' | 'medium' | 'low' | string;
|
|
29
|
+
reason?: string;
|
|
30
|
+
all_packs: AvailablePackSummary[];
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface ActivateVocabularyPackInput {
|
|
34
|
+
pack_id: string;
|
|
35
|
+
/** Required by POST .../enable body; defaults to client organization_id. */
|
|
36
|
+
organization_id?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ActivateVocabularyPackResult {
|
|
39
|
+
pack_id: string;
|
|
40
|
+
organization_id: string;
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
enabled_at: string;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
export interface PacksApiDeps {
|
|
46
|
+
organization_id?: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=packs-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packs-types.d.ts","sourceRoot":"","sources":["../../src/client/packs-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAC;AAElF,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packs-types.js","sourceRoot":"","sources":["../../src/client/packs-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vocabulary pack lifecycle API (LOX-1242).
|
|
3
|
+
* MCP loxtep_meaning ops (semantic-layer REST) — not loxtep_define.
|
|
4
|
+
*
|
|
5
|
+
* GET /graph/admin/vocabulary-packs/recommend
|
|
6
|
+
* POST /graph/admin/vocabulary-packs/{pack_id}/enable
|
|
7
|
+
* GET /graph/semantic-layer/activation-state
|
|
8
|
+
*/
|
|
9
|
+
import type { LoxtepHttpClient } from '../http/client.js';
|
|
10
|
+
import type { ActivateVocabularyPackInput, ActivateVocabularyPackResult, ListAvailablePacksResult, PackActivationStatus, PacksApiDeps } from './packs-types.js';
|
|
11
|
+
/** Normalize camelCase (graph handler) or snake_case (MCP docs) activation payloads. */
|
|
12
|
+
export declare function normalizePackActivationStatus(raw: unknown): PackActivationStatus;
|
|
13
|
+
/** Normalize recommend payload, or wrap bare admin list arrays. */
|
|
14
|
+
export declare function normalizeListAvailablePacksResult(raw: unknown): ListAvailablePacksResult;
|
|
15
|
+
export declare function createPacksApi(http: LoxtepHttpClient, deps?: PacksApiDeps): {
|
|
16
|
+
list_available: () => Promise<ListAvailablePacksResult>;
|
|
17
|
+
/** MCP operation alias. */
|
|
18
|
+
list_available_packs: () => Promise<ListAvailablePacksResult>;
|
|
19
|
+
activate: (input: ActivateVocabularyPackInput | string) => Promise<ActivateVocabularyPackResult>;
|
|
20
|
+
/** MCP operation alias. */
|
|
21
|
+
activate_vocabulary_pack: (input: ActivateVocabularyPackInput | string) => Promise<ActivateVocabularyPackResult>;
|
|
22
|
+
get_activation_status: () => Promise<PackActivationStatus>;
|
|
23
|
+
/** MCP operation alias. */
|
|
24
|
+
get_pack_activation_status: () => Promise<PackActivationStatus>;
|
|
25
|
+
};
|
|
26
|
+
export type PacksApi = ReturnType<typeof createPacksApi>;
|
|
27
|
+
//# sourceMappingURL=packs.d.ts.map
|