@manta-eu/client 0.1.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 +21 -0
- package/dist/generated/graphql.d.ts +4719 -0
- package/dist/generated/graphql.d.ts.map +1 -0
- package/dist/generated/graphql.js +2452 -0
- package/dist/graphql-clients.d.ts +9 -0
- package/dist/graphql-clients.d.ts.map +1 -0
- package/dist/graphql-clients.js +27 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/shared/action-plan.d.ts +2 -0
- package/dist/shared/action-plan.d.ts.map +1 -0
- package/dist/shared/action-plan.js +1 -0
- package/dist/shared/agent-mode.d.ts +9 -0
- package/dist/shared/agent-mode.d.ts.map +1 -0
- package/dist/shared/agent-mode.js +38 -0
- package/dist/shared/agent-types.d.ts +41 -0
- package/dist/shared/agent-types.d.ts.map +1 -0
- package/dist/shared/agent-types.js +12 -0
- package/dist/shared/chat-context.d.ts +7 -0
- package/dist/shared/chat-context.d.ts.map +1 -0
- package/dist/shared/chat-context.js +38 -0
- package/dist/shared/chat-manager.d.ts +183 -0
- package/dist/shared/chat-manager.d.ts.map +1 -0
- package/dist/shared/chat-manager.js +75 -0
- package/dist/shared/chat-turn-errors.d.ts +16 -0
- package/dist/shared/chat-turn-errors.d.ts.map +1 -0
- package/dist/shared/chat-turn-errors.js +18 -0
- package/dist/shared/constants.d.ts +11 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +10 -0
- package/dist/shared/conversation-starter-defaults.d.ts +8 -0
- package/dist/shared/conversation-starter-defaults.d.ts.map +1 -0
- package/dist/shared/conversation-starter-defaults.js +20 -0
- package/dist/shared/datastore-id.d.ts +4 -0
- package/dist/shared/datastore-id.d.ts.map +1 -0
- package/dist/shared/datastore-id.js +17 -0
- package/dist/shared/datastore-path.d.ts +19 -0
- package/dist/shared/datastore-path.d.ts.map +1 -0
- package/dist/shared/datastore-path.js +62 -0
- package/dist/shared/datastore-route-table.d.ts +36 -0
- package/dist/shared/datastore-route-table.d.ts.map +1 -0
- package/dist/shared/datastore-route-table.js +43 -0
- package/dist/shared/duration.d.ts +6 -0
- package/dist/shared/duration.d.ts.map +1 -0
- package/dist/shared/duration.js +55 -0
- package/dist/shared/entity-set.d.ts +14 -0
- package/dist/shared/entity-set.d.ts.map +1 -0
- package/dist/shared/entity-set.js +25 -0
- package/dist/shared/error-utils.d.ts +23 -0
- package/dist/shared/error-utils.d.ts.map +1 -0
- package/dist/shared/error-utils.js +56 -0
- package/dist/shared/explorer-paths.d.ts +4 -0
- package/dist/shared/explorer-paths.d.ts.map +1 -0
- package/dist/shared/explorer-paths.js +7 -0
- package/dist/shared/fileIri.d.ts +12 -0
- package/dist/shared/fileIri.d.ts.map +1 -0
- package/dist/shared/fileIri.js +18 -0
- package/dist/shared/index.d.ts +22 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +8 -0
- package/dist/shared/live-context.d.ts +2 -0
- package/dist/shared/live-context.d.ts.map +1 -0
- package/dist/shared/live-context.js +15 -0
- package/dist/shared/maintenance-schedule.d.ts +11 -0
- package/dist/shared/maintenance-schedule.d.ts.map +1 -0
- package/dist/shared/maintenance-schedule.js +38 -0
- package/dist/shared/memory-citation-sampling.d.ts +16 -0
- package/dist/shared/memory-citation-sampling.d.ts.map +1 -0
- package/dist/shared/memory-citation-sampling.js +14 -0
- package/dist/shared/memory-confidence.d.ts +3 -0
- package/dist/shared/memory-confidence.d.ts.map +1 -0
- package/dist/shared/memory-confidence.js +7 -0
- package/dist/shared/memory-consolidation-limits.d.ts +6 -0
- package/dist/shared/memory-consolidation-limits.d.ts.map +1 -0
- package/dist/shared/memory-consolidation-limits.js +5 -0
- package/dist/shared/memory-dates.d.ts +3 -0
- package/dist/shared/memory-dates.d.ts.map +1 -0
- package/dist/shared/memory-dates.js +7 -0
- package/dist/shared/memory-decay.d.ts +22 -0
- package/dist/shared/memory-decay.d.ts.map +1 -0
- package/dist/shared/memory-decay.js +43 -0
- package/dist/shared/memory-diversity.d.ts +10 -0
- package/dist/shared/memory-diversity.d.ts.map +1 -0
- package/dist/shared/memory-diversity.js +44 -0
- package/dist/shared/memory-entity-recall.d.ts +8 -0
- package/dist/shared/memory-entity-recall.d.ts.map +1 -0
- package/dist/shared/memory-entity-recall.js +17 -0
- package/dist/shared/memory-importance.d.ts +4 -0
- package/dist/shared/memory-importance.d.ts.map +1 -0
- package/dist/shared/memory-importance.js +9 -0
- package/dist/shared/memory-keyword-recall.d.ts +13 -0
- package/dist/shared/memory-keyword-recall.d.ts.map +1 -0
- package/dist/shared/memory-keyword-recall.js +141 -0
- package/dist/shared/memory-kind-iris.d.ts +9 -0
- package/dist/shared/memory-kind-iris.d.ts.map +1 -0
- package/dist/shared/memory-kind-iris.js +22 -0
- package/dist/shared/memory-preload-gate.d.ts +37 -0
- package/dist/shared/memory-preload-gate.d.ts.map +1 -0
- package/dist/shared/memory-preload-gate.js +95 -0
- package/dist/shared/memory-sources.d.ts +3 -0
- package/dist/shared/memory-sources.d.ts.map +1 -0
- package/dist/shared/memory-sources.js +3 -0
- package/dist/shared/memory-teams.d.ts +2 -0
- package/dist/shared/memory-teams.d.ts.map +1 -0
- package/dist/shared/memory-teams.js +3 -0
- package/dist/shared/memory-token-budget.d.ts +8 -0
- package/dist/shared/memory-token-budget.d.ts.map +1 -0
- package/dist/shared/memory-token-budget.js +23 -0
- package/dist/shared/memory-volatility.d.ts +24 -0
- package/dist/shared/memory-volatility.d.ts.map +1 -0
- package/dist/shared/memory-volatility.js +55 -0
- package/dist/shared/message-utils.d.ts +12 -0
- package/dist/shared/message-utils.d.ts.map +1 -0
- package/dist/shared/message-utils.js +22 -0
- package/dist/shared/model.d.ts +165 -0
- package/dist/shared/model.d.ts.map +1 -0
- package/dist/shared/model.js +93 -0
- package/dist/shared/org-roles.d.ts +11 -0
- package/dist/shared/org-roles.d.ts.map +1 -0
- package/dist/shared/org-roles.js +10 -0
- package/dist/shared/page-context.d.ts +7 -0
- package/dist/shared/page-context.d.ts.map +1 -0
- package/dist/shared/page-context.js +1 -0
- package/dist/shared/permissions.d.ts +9 -0
- package/dist/shared/permissions.d.ts.map +1 -0
- package/dist/shared/permissions.js +10 -0
- package/dist/shared/questionnaire.d.ts +32 -0
- package/dist/shared/questionnaire.d.ts.map +1 -0
- package/dist/shared/questionnaire.js +68 -0
- package/dist/shared/rdf-namespaces.d.ts +11 -0
- package/dist/shared/rdf-namespaces.d.ts.map +1 -0
- package/dist/shared/rdf-namespaces.js +15 -0
- package/dist/shared/rule-iri.d.ts +4 -0
- package/dist/shared/rule-iri.d.ts.map +1 -0
- package/dist/shared/rule-iri.js +13 -0
- package/dist/shared/rule-search.d.ts +2 -0
- package/dist/shared/rule-search.d.ts.map +1 -0
- package/dist/shared/rule-search.js +1 -0
- package/dist/shared/session-types.d.ts +14 -0
- package/dist/shared/session-types.d.ts.map +1 -0
- package/dist/shared/session-types.js +1 -0
- package/dist/shared/spa-routes.d.ts +3 -0
- package/dist/shared/spa-routes.d.ts.map +1 -0
- package/dist/shared/spa-routes.js +5 -0
- package/dist/shared/stakeholder-iri.d.ts +7 -0
- package/dist/shared/stakeholder-iri.d.ts.map +1 -0
- package/dist/shared/stakeholder-iri.js +20 -0
- package/dist/shared/team-activation.d.ts +7 -0
- package/dist/shared/team-activation.d.ts.map +1 -0
- package/dist/shared/team-activation.js +3 -0
- package/dist/shared/team.d.ts +150 -0
- package/dist/shared/team.d.ts.map +1 -0
- package/dist/shared/team.js +88 -0
- package/dist/shared/tools/coercers.d.ts +6 -0
- package/dist/shared/tools/coercers.d.ts.map +1 -0
- package/dist/shared/tools/coercers.js +63 -0
- package/dist/shared/tools/index.d.ts +4 -0
- package/dist/shared/tools/index.d.ts.map +1 -0
- package/dist/shared/tools/index.js +2 -0
- package/dist/shared/tools/metadata.d.ts +12 -0
- package/dist/shared/tools/metadata.d.ts.map +1 -0
- package/dist/shared/tools/metadata.js +215 -0
- package/dist/shared/tools/test-triple.d.ts +16 -0
- package/dist/shared/tools/test-triple.d.ts.map +1 -0
- package/dist/shared/tools/test-triple.js +26 -0
- package/dist/shared/tools/types.d.ts +236 -0
- package/dist/shared/tools/types.d.ts.map +1 -0
- package/dist/shared/tools/types.js +1 -0
- package/dist/shared/upload.d.ts +26 -0
- package/dist/shared/upload.d.ts.map +1 -0
- package/dist/shared/upload.js +26 -0
- package/dist/shared/website-url.d.ts +5 -0
- package/dist/shared/website-url.d.ts.map +1 -0
- package/dist/shared/website-url.js +31 -0
- package/dist/shared/workspace-artifacts.d.ts +21 -0
- package/dist/shared/workspace-artifacts.d.ts.map +1 -0
- package/dist/shared/workspace-artifacts.js +59 -0
- package/dist/shared/writable-shape-query.d.ts +2 -0
- package/dist/shared/writable-shape-query.d.ts.map +1 -0
- package/dist/shared/writable-shape-query.js +21 -0
- package/dist/types/jsonld.d.ts +2 -0
- package/dist/types/jsonld.d.ts.map +1 -0
- package/dist/types/jsonld.js +1 -0
- package/dist/types/sparql-types.d.ts +3 -0
- package/dist/types/sparql-types.d.ts.map +1 -0
- package/dist/types/sparql-types.js +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
const iriValueSchema = z.string().min(1).describe("Full HTTP(S) or known prefixed IRI, without SPARQL brackets");
|
|
3
|
+
const iriObjectInputSchema = z.object({
|
|
4
|
+
type: z.literal("iri"),
|
|
5
|
+
value: iriValueSchema,
|
|
6
|
+
});
|
|
7
|
+
const languageTagPattern = /^[A-Za-z]+(?:-[A-Za-z0-9]+)*$/;
|
|
8
|
+
const literalTermInputSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
type: z.literal("literal"),
|
|
11
|
+
value: z.string().describe("Literal lexical value, without SPARQL quotes"),
|
|
12
|
+
datatype: z.string().min(1).optional().describe("Optional full or known prefixed datatype IRI"),
|
|
13
|
+
language: z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(languageTagPattern, "Invalid language tag")
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Optional BCP 47 language tag"),
|
|
18
|
+
})
|
|
19
|
+
.refine(({ datatype, language }) => !(datatype && language), {
|
|
20
|
+
message: "A literal cannot have both datatype and language",
|
|
21
|
+
});
|
|
22
|
+
export const testTripleInputSchema = z.object({
|
|
23
|
+
subject: iriValueSchema.describe("Expected triple subject IRI"),
|
|
24
|
+
predicate: iriValueSchema.describe("Expected triple predicate IRI"),
|
|
25
|
+
object: z.discriminatedUnion("type", [iriObjectInputSchema, literalTermInputSchema]),
|
|
26
|
+
});
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { JsonLdGraphDocument } from "#types/jsonld";
|
|
2
|
+
import type { SparqlBinding, SparqlJsonResults } from "#types/sparql-types";
|
|
3
|
+
import type { DatalogRule, InferenceVerificationResult } from "@manta-eu/datalog-parser";
|
|
4
|
+
import type { z } from "zod/v4";
|
|
5
|
+
import type { TestTripleInput } from "./test-triple.js";
|
|
6
|
+
export type { SparqlBinding, SparqlJsonResults, SparqlValue } from "#types/sparql-types";
|
|
7
|
+
export type { TestTripleInput };
|
|
8
|
+
export type SparqlJsonBinding = SparqlBinding;
|
|
9
|
+
export type ToolName = "getRDFoxFacts" | "addRDFoxFacts" | "getRDFoxRules" | "explainRDFoxRules" | "scheduleTask" | "listScheduledTasks" | "cancelSchedule" | "generateChart" | "executeActionPlan" | "manageRDFoxRules" | "manageRDFoxFacts" | "actionPlanShowcase" | "showEntities" | "enableAutoPilot" | "enableAutoPilotCron" | "disableAutoPilot" | "checkAutoPilotStatus" | "setAutoPilotCadence" | "markAsLowRisk" | "readUploadedFile";
|
|
10
|
+
export type ToolCategory = "rdfox" | "scheduler" | "charts" | "action" | "auto-pilot";
|
|
11
|
+
export type ToolInputSchema<T = unknown> = z.ZodSchema<T>;
|
|
12
|
+
export type ToolOutput<T = unknown> = T | ToolErrorResult;
|
|
13
|
+
export type ToolErrorResult = {
|
|
14
|
+
is_error: true;
|
|
15
|
+
content: string;
|
|
16
|
+
};
|
|
17
|
+
export type RDFoxFactsInput = {
|
|
18
|
+
humanIntent: string;
|
|
19
|
+
sparql: string;
|
|
20
|
+
keepPrefixes?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type RDFoxFactsOutput = JsonLdGraphDocument | SparqlJsonResults | ToolErrorResult;
|
|
23
|
+
export type AddRDFoxFactsInput = {
|
|
24
|
+
facts: string;
|
|
25
|
+
humanIntent: string;
|
|
26
|
+
};
|
|
27
|
+
export type AddRDFoxFactsOutput = string | ToolErrorResult;
|
|
28
|
+
export type GetRDFoxRulesInput = {
|
|
29
|
+
namedGraphIri?: string;
|
|
30
|
+
rdfTypes?: string[];
|
|
31
|
+
limit?: number;
|
|
32
|
+
};
|
|
33
|
+
export type GetRDFoxRulesOutputSuccess = {
|
|
34
|
+
rules: string[] | string | Record<string, unknown>[];
|
|
35
|
+
totalCount: number;
|
|
36
|
+
truncated?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type GetRDFoxRulesOutput = GetRDFoxRulesOutputSuccess | ToolErrorResult;
|
|
39
|
+
export type ExplainRDFoxRulesInput = {
|
|
40
|
+
subject: string;
|
|
41
|
+
predicate?: string;
|
|
42
|
+
object: string;
|
|
43
|
+
};
|
|
44
|
+
export type ToolObjectOutput = object | ToolErrorResult;
|
|
45
|
+
export type ExplainRDFoxRulesOutput = ToolObjectOutput;
|
|
46
|
+
export type ScheduleTaskInput = {
|
|
47
|
+
when: "scheduled" | "delayed" | "cron";
|
|
48
|
+
description: string;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
export type ScheduleTaskOutput = ToolObjectOutput;
|
|
52
|
+
export type ListScheduledTasksInput = Record<string, never>;
|
|
53
|
+
export type ListScheduledTasksOutput = Array<object> | ToolErrorResult;
|
|
54
|
+
export type CancelScheduleInput = {
|
|
55
|
+
id: string;
|
|
56
|
+
};
|
|
57
|
+
export type CancelScheduleOutput = ToolObjectOutput;
|
|
58
|
+
export type GenerateChartInputData = {
|
|
59
|
+
x?: string | number;
|
|
60
|
+
y?: number;
|
|
61
|
+
name?: string;
|
|
62
|
+
value?: number;
|
|
63
|
+
subject?: string;
|
|
64
|
+
barValue?: number;
|
|
65
|
+
lineValue?: number;
|
|
66
|
+
};
|
|
67
|
+
export type GenerateChartType = "line" | "area" | "bar" | "pie" | "scatter" | "radar" | "composed";
|
|
68
|
+
export type GenerateChartInput = {
|
|
69
|
+
type: GenerateChartType;
|
|
70
|
+
title?: string;
|
|
71
|
+
data: GenerateChartInputData[];
|
|
72
|
+
height?: number;
|
|
73
|
+
xAxisLabel?: string;
|
|
74
|
+
yAxisLabel?: string;
|
|
75
|
+
barLabel?: string;
|
|
76
|
+
lineLabel?: string;
|
|
77
|
+
};
|
|
78
|
+
export type GenerateChartOutput = {
|
|
79
|
+
type: "chart";
|
|
80
|
+
chartType: GenerateChartType;
|
|
81
|
+
data: object;
|
|
82
|
+
message: string;
|
|
83
|
+
};
|
|
84
|
+
export type ExecuteActionPlanInput = {
|
|
85
|
+
namedGraphIri: string;
|
|
86
|
+
shaclShapeIri?: string;
|
|
87
|
+
dryRun?: boolean;
|
|
88
|
+
autoApprove?: boolean;
|
|
89
|
+
};
|
|
90
|
+
export type ExecuteActionPlanOutput = {
|
|
91
|
+
planValidation?: {
|
|
92
|
+
valid: boolean;
|
|
93
|
+
completeness: number;
|
|
94
|
+
issues?: string[];
|
|
95
|
+
};
|
|
96
|
+
semanticDiff?: {
|
|
97
|
+
creates: number;
|
|
98
|
+
updates: number;
|
|
99
|
+
deletes: number;
|
|
100
|
+
operations: unknown[];
|
|
101
|
+
};
|
|
102
|
+
workflowId?: string;
|
|
103
|
+
data?: unknown;
|
|
104
|
+
} | ToolErrorResult;
|
|
105
|
+
export type ManageRDFoxRulesInput = {
|
|
106
|
+
humanIntent: string;
|
|
107
|
+
operation: "add" | "change" | "remove";
|
|
108
|
+
ruleIri?: string;
|
|
109
|
+
newRule?: string;
|
|
110
|
+
testTriple?: TestTripleInput;
|
|
111
|
+
expectNoInference?: boolean;
|
|
112
|
+
dryRun?: boolean;
|
|
113
|
+
stageOnly?: boolean;
|
|
114
|
+
};
|
|
115
|
+
export type ManageRDFoxRulesSuccess = {
|
|
116
|
+
success: true;
|
|
117
|
+
ruleIri: string;
|
|
118
|
+
parsedRule: DatalogRule | null;
|
|
119
|
+
content: string;
|
|
120
|
+
};
|
|
121
|
+
export type ManageRDFoxRulesOutput = (ManageRDFoxRulesSuccess & {
|
|
122
|
+
dryRun: true;
|
|
123
|
+
}) | (ManageRDFoxRulesSuccess & {
|
|
124
|
+
staged: true;
|
|
125
|
+
}) | (ManageRDFoxRulesSuccess & {
|
|
126
|
+
ruleText: string;
|
|
127
|
+
inferenceVerified: boolean;
|
|
128
|
+
inferenceVerification: InferenceVerificationResult | null;
|
|
129
|
+
commitSummary: {
|
|
130
|
+
rulesAdded: number;
|
|
131
|
+
rulesUpdated: number;
|
|
132
|
+
rulesDeleted: number;
|
|
133
|
+
};
|
|
134
|
+
}) | ToolErrorResult;
|
|
135
|
+
export type ManageRDFoxFactsInput = {
|
|
136
|
+
humanIntent: string;
|
|
137
|
+
facts: string;
|
|
138
|
+
namedGraphIri?: string;
|
|
139
|
+
operation?: "add" | "update";
|
|
140
|
+
etag?: string;
|
|
141
|
+
};
|
|
142
|
+
export type ManageRDFoxFactsOutput = {
|
|
143
|
+
content: string;
|
|
144
|
+
is_error: boolean;
|
|
145
|
+
} | ToolErrorResult;
|
|
146
|
+
export type ActionPlanStatus = "DRAFT" | "RUNNING" | "COMPLETED" | "FAILED" | "TIMED_OUT";
|
|
147
|
+
export type ActionPlanShowcaseInput = {
|
|
148
|
+
actionPlanIRI: string;
|
|
149
|
+
};
|
|
150
|
+
export type ActionPlanShowcaseOutput = {
|
|
151
|
+
planIri: string;
|
|
152
|
+
planName: string;
|
|
153
|
+
status: ActionPlanStatus;
|
|
154
|
+
} | ToolErrorResult;
|
|
155
|
+
export type ShowEntitiesInput = {
|
|
156
|
+
entityIris: string[];
|
|
157
|
+
};
|
|
158
|
+
export type ShowEntitiesOutput = {
|
|
159
|
+
entityIris: string[];
|
|
160
|
+
graph: JsonLdGraphDocument;
|
|
161
|
+
message?: string;
|
|
162
|
+
} | ToolErrorResult;
|
|
163
|
+
export type ReadUploadedFileInput = {
|
|
164
|
+
fileIri: string;
|
|
165
|
+
};
|
|
166
|
+
export type ReadUploadedFileOutput = string | ToolErrorResult;
|
|
167
|
+
export type ToolDefinition<TInput = unknown, _TOutput = unknown> = {
|
|
168
|
+
name: ToolName;
|
|
169
|
+
category: ToolCategory;
|
|
170
|
+
description: string;
|
|
171
|
+
inputSchema: ToolInputSchema<TInput>;
|
|
172
|
+
humanName: string;
|
|
173
|
+
getHumanName: (input?: TInput) => string;
|
|
174
|
+
};
|
|
175
|
+
export type AutoPilotInput = {
|
|
176
|
+
humanIntent: string;
|
|
177
|
+
planId: string;
|
|
178
|
+
};
|
|
179
|
+
export type EnableAutoPilotInput = AutoPilotInput & {
|
|
180
|
+
cadence: string;
|
|
181
|
+
};
|
|
182
|
+
export type EnableAutoPilotCronInput = AutoPilotInput & {
|
|
183
|
+
cron: string;
|
|
184
|
+
timezone?: string;
|
|
185
|
+
};
|
|
186
|
+
export type AutoPilotActionPlan = {
|
|
187
|
+
namedGraphIri: string;
|
|
188
|
+
autoPilotEnabled?: boolean | null;
|
|
189
|
+
scheduledCadence?: string | null;
|
|
190
|
+
scheduledCron?: string | null;
|
|
191
|
+
scheduleTimezone?: string | null;
|
|
192
|
+
autoPilotEnabledAt?: string | null;
|
|
193
|
+
autoPilotEnabledBy?: string | null;
|
|
194
|
+
executionCount?: number | null;
|
|
195
|
+
lastExecutedAt?: string | null;
|
|
196
|
+
hasTrustThreshold?: boolean | null;
|
|
197
|
+
isLowRisk?: boolean | null;
|
|
198
|
+
};
|
|
199
|
+
export type AutoPilotOutput = ({
|
|
200
|
+
success: true;
|
|
201
|
+
} & AutoPilotActionPlan) | ToolErrorResult;
|
|
202
|
+
export type CheckAutoPilotStatusOutput = AutoPilotActionPlan | ToolErrorResult;
|
|
203
|
+
export type ToolDefinitions = {
|
|
204
|
+
getRDFoxFacts: ToolDefinition<RDFoxFactsInput, RDFoxFactsOutput>;
|
|
205
|
+
addRDFoxFacts: ToolDefinition<AddRDFoxFactsInput, AddRDFoxFactsOutput>;
|
|
206
|
+
getRDFoxRules: ToolDefinition<GetRDFoxRulesInput, GetRDFoxRulesOutput>;
|
|
207
|
+
explainRDFoxRules: ToolDefinition<ExplainRDFoxRulesInput, ExplainRDFoxRulesOutput>;
|
|
208
|
+
scheduleTask: ToolDefinition<ScheduleTaskInput, ScheduleTaskOutput>;
|
|
209
|
+
listScheduledTasks: ToolDefinition<ListScheduledTasksInput, ListScheduledTasksOutput>;
|
|
210
|
+
cancelSchedule: ToolDefinition<CancelScheduleInput, CancelScheduleOutput>;
|
|
211
|
+
generateChart: ToolDefinition<GenerateChartInput, GenerateChartOutput>;
|
|
212
|
+
executeActionPlan: ToolDefinition<ExecuteActionPlanInput, ExecuteActionPlanOutput>;
|
|
213
|
+
manageRDFoxRules: ToolDefinition<ManageRDFoxRulesInput, ManageRDFoxRulesOutput>;
|
|
214
|
+
manageRDFoxFacts: ToolDefinition<ManageRDFoxFactsInput, ManageRDFoxFactsOutput>;
|
|
215
|
+
actionPlanShowcase: ToolDefinition<ActionPlanShowcaseInput, ActionPlanShowcaseOutput>;
|
|
216
|
+
showEntities: ToolDefinition<ShowEntitiesInput, ShowEntitiesOutput>;
|
|
217
|
+
enableAutoPilot: ToolDefinition<EnableAutoPilotInput, AutoPilotOutput>;
|
|
218
|
+
enableAutoPilotCron: ToolDefinition<EnableAutoPilotCronInput, AutoPilotOutput>;
|
|
219
|
+
disableAutoPilot: ToolDefinition<AutoPilotInput, AutoPilotOutput>;
|
|
220
|
+
checkAutoPilotStatus: ToolDefinition<AutoPilotInput, CheckAutoPilotStatusOutput>;
|
|
221
|
+
setAutoPilotCadence: ToolDefinition<EnableAutoPilotInput, AutoPilotOutput>;
|
|
222
|
+
markAsLowRisk: ToolDefinition<AutoPilotInput, AutoPilotOutput>;
|
|
223
|
+
readUploadedFile: ToolDefinition<ReadUploadedFileInput, ReadUploadedFileOutput>;
|
|
224
|
+
};
|
|
225
|
+
export type ToolMetadata = {
|
|
226
|
+
[K in ToolName]: {
|
|
227
|
+
name: K;
|
|
228
|
+
category: ToolCategory;
|
|
229
|
+
humanName: string;
|
|
230
|
+
description: string;
|
|
231
|
+
getHumanName: (input?: ToolDefinitions[K] extends ToolDefinition<infer TInput, unknown> ? TInput : unknown) => string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
export type ToolOutputType<T extends ToolName> = ToolDefinitions[T] extends ToolDefinition<unknown, infer TOutput> ? TOutput : unknown;
|
|
235
|
+
export type ToolOutputCoercer<T extends ToolName> = (raw: unknown) => ToolOutputType<T>;
|
|
236
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/tools/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzF,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAChB,eAAe,GACf,eAAe,GACf,eAAe,GACf,mBAAmB,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QACpB,YAAY,EAAE,CACZ,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,OAAO,KACxF,MAAM,CAAC;KACb;CACF,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,QAAQ,IAC3C,eAAe,CAAC,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC;AAExF,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,GAAG,EAAE,OAAO,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const uploadPartSize: number;
|
|
2
|
+
export declare function bytesToHex(buffer: ArrayBuffer): string;
|
|
3
|
+
export declare function sha256Hex(bytes: BufferSource): Promise<string>;
|
|
4
|
+
export type FileFacts = {
|
|
5
|
+
byteSize: number;
|
|
6
|
+
sha256?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
};
|
|
10
|
+
export type UploadedPartEtag = {
|
|
11
|
+
partNumber: number;
|
|
12
|
+
etag: string;
|
|
13
|
+
};
|
|
14
|
+
export type UploadedFileReference = {
|
|
15
|
+
fileIri: string;
|
|
16
|
+
storageKey: string;
|
|
17
|
+
fileName: string;
|
|
18
|
+
mediaType: string;
|
|
19
|
+
byteSize: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function normalizeMediaType(mediaType: string): string;
|
|
22
|
+
export declare const maxFileNameBytes = 255;
|
|
23
|
+
export declare function isFileNameTooLong(fileName: string): boolean;
|
|
24
|
+
export declare function mediaTypeFromExtension(extension: string | undefined): string;
|
|
25
|
+
export declare function mediaTypeFromFileName(fileName: string): string;
|
|
26
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/shared/upload.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,UAE7C;AAED,wBAAsB,SAAS,CAAC,KAAK,EAAE,YAAY,mBAIlD;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,UAInD;AAED,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,WAEjD;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,UAEnE;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,UAErD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getExtension } from "@manta-eu/lib/file";
|
|
2
|
+
import mime from "mime";
|
|
3
|
+
import { MIMEType } from "whatwg-mimetype";
|
|
4
|
+
export const uploadPartSize = 8 * 1024 * 1024;
|
|
5
|
+
export function bytesToHex(buffer) {
|
|
6
|
+
return [...new Uint8Array(buffer)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
7
|
+
}
|
|
8
|
+
export async function sha256Hex(bytes) {
|
|
9
|
+
const digest = await crypto.subtle.digest("SHA-256", bytes);
|
|
10
|
+
return bytesToHex(digest);
|
|
11
|
+
}
|
|
12
|
+
const maxMediaTypeLength = 255;
|
|
13
|
+
export function normalizeMediaType(mediaType) {
|
|
14
|
+
const essence = MIMEType.parse(mediaType)?.essence ?? "";
|
|
15
|
+
return essence.length > maxMediaTypeLength ? "" : essence;
|
|
16
|
+
}
|
|
17
|
+
export const maxFileNameBytes = 255;
|
|
18
|
+
export function isFileNameTooLong(fileName) {
|
|
19
|
+
return new TextEncoder().encode(fileName).length > maxFileNameBytes;
|
|
20
|
+
}
|
|
21
|
+
export function mediaTypeFromExtension(extension) {
|
|
22
|
+
return (extension ? mime.getType(extension) : undefined) ?? "application/octet-stream";
|
|
23
|
+
}
|
|
24
|
+
export function mediaTypeFromFileName(fileName) {
|
|
25
|
+
return mediaTypeFromExtension(getExtension(fileName));
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function withHttpsScheme(raw: string): string;
|
|
2
|
+
export declare function websiteUrl(raw: string | null | undefined): string | undefined;
|
|
3
|
+
export declare function validWebsiteUrl(raw: string | null | undefined): string | undefined;
|
|
4
|
+
export declare function websiteHost(raw: string): string;
|
|
5
|
+
//# sourceMappingURL=website-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website-url.d.ts","sourceRoot":"","sources":["../../src/shared/website-url.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnD;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG7E;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAUlF;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM/C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isPresent } from "@manta-eu/lib/present";
|
|
2
|
+
export function withHttpsScheme(raw) {
|
|
3
|
+
const trimmed = raw.trim();
|
|
4
|
+
return /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
5
|
+
}
|
|
6
|
+
// Not round-tripped through URL, which would append a path the graph's existing subjects lack.
|
|
7
|
+
export function websiteUrl(raw) {
|
|
8
|
+
if (!isPresent(raw?.trim()))
|
|
9
|
+
return undefined;
|
|
10
|
+
return withHttpsScheme(raw);
|
|
11
|
+
}
|
|
12
|
+
export function validWebsiteUrl(raw) {
|
|
13
|
+
const candidate = websiteUrl(raw);
|
|
14
|
+
if (!isPresent(candidate))
|
|
15
|
+
return undefined;
|
|
16
|
+
try {
|
|
17
|
+
const url = new URL(candidate);
|
|
18
|
+
return url.protocol === "http:" || url.protocol === "https:" ? url.toString() : undefined;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function websiteHost(raw) {
|
|
25
|
+
try {
|
|
26
|
+
return new URL(withHttpsScheme(raw)).hostname.replace(/^www\./, "");
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return raw;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
export declare const workspaceArtifactMaxByteSize = 1500000;
|
|
3
|
+
export declare function isWorkspaceArtifactInlineMediaType(mediaType: string): boolean;
|
|
4
|
+
export declare const workspaceArtifactIdSchema: z.ZodUUID;
|
|
5
|
+
export declare const workspaceArtifactSchema: z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"workspace-artifact">;
|
|
7
|
+
artifactId: z.ZodUUID;
|
|
8
|
+
filename: z.ZodString;
|
|
9
|
+
mediaType: z.ZodString;
|
|
10
|
+
byteSize: z.ZodNumber;
|
|
11
|
+
url: z.ZodString;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export type WorkspaceArtifact = z.infer<typeof workspaceArtifactSchema>;
|
|
14
|
+
export declare const publishWorkspaceFileInputSchema: z.ZodObject<{
|
|
15
|
+
path: z.ZodString;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export declare function buildWorkspaceArtifactUrl(input: {
|
|
18
|
+
conversationId: string;
|
|
19
|
+
artifactId: string;
|
|
20
|
+
}): string;
|
|
21
|
+
//# sourceMappingURL=workspace-artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-artifacts.d.ts","sourceRoot":"","sources":["../../src/shared/workspace-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAK3B,eAAO,MAAM,4BAA4B,UAAY,CAAC;AAUtD,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE7E;AAED,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAoBlD,eAAO,MAAM,uBAAuB;;;;;;;kBAkBhC,CAAC;AAEL,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,+BAA+B;;kBAE1C,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEvG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
import { chatIdSchema, chatManagerBasePath, thinkChatFacetPath } from "./chat-manager.js";
|
|
3
|
+
import { normalizeMediaType } from "./upload.js";
|
|
4
|
+
// Changing this value requires `pnpm db:generate:chat-think` so the SQLite CHECK constraint stays in sync.
|
|
5
|
+
export const workspaceArtifactMaxByteSize = 1_500_000;
|
|
6
|
+
const workspaceArtifactRoutePrefix = `/${chatManagerBasePath}/sub/${thinkChatFacetPath}/`;
|
|
7
|
+
const workspaceArtifactInlineMediaTypes = new Set([
|
|
8
|
+
"image/avif",
|
|
9
|
+
"image/gif",
|
|
10
|
+
"image/jpeg",
|
|
11
|
+
"image/png",
|
|
12
|
+
"image/webp",
|
|
13
|
+
]);
|
|
14
|
+
export function isWorkspaceArtifactInlineMediaType(mediaType) {
|
|
15
|
+
return workspaceArtifactInlineMediaTypes.has(mediaType);
|
|
16
|
+
}
|
|
17
|
+
export const workspaceArtifactIdSchema = z.uuid();
|
|
18
|
+
function isWorkspaceArtifactUrl(input) {
|
|
19
|
+
if (!input.url.startsWith(workspaceArtifactRoutePrefix))
|
|
20
|
+
return false;
|
|
21
|
+
const segments = input.url.slice(workspaceArtifactRoutePrefix.length).split("/");
|
|
22
|
+
if (segments.length !== 3)
|
|
23
|
+
return false;
|
|
24
|
+
const [encodedConversationId, artifactMarker, artifactId] = segments;
|
|
25
|
+
if (artifactMarker !== "artifacts" || artifactId !== input.artifactId) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
return chatIdSchema.safeParse(decodeURIComponent(encodedConversationId ?? "")).success;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const workspaceArtifactSchema = z
|
|
36
|
+
.strictObject({
|
|
37
|
+
type: z.literal("workspace-artifact"),
|
|
38
|
+
artifactId: workspaceArtifactIdSchema,
|
|
39
|
+
filename: z.string().trim().min(1).max(255),
|
|
40
|
+
mediaType: z
|
|
41
|
+
.string()
|
|
42
|
+
.min(1)
|
|
43
|
+
.max(255)
|
|
44
|
+
.refine((mediaType) => normalizeMediaType(mediaType) === mediaType, {
|
|
45
|
+
message: "Media type must be a normalized MIME essence",
|
|
46
|
+
}),
|
|
47
|
+
byteSize: z.number().int().nonnegative().max(workspaceArtifactMaxByteSize),
|
|
48
|
+
url: z.string(),
|
|
49
|
+
})
|
|
50
|
+
.refine(isWorkspaceArtifactUrl, {
|
|
51
|
+
message: "Artifact URL must match its conversation-scoped artifact route",
|
|
52
|
+
path: ["url"],
|
|
53
|
+
});
|
|
54
|
+
export const publishWorkspaceFileInputSchema = z.strictObject({
|
|
55
|
+
path: z.string().trim().min(1).max(4096),
|
|
56
|
+
});
|
|
57
|
+
export function buildWorkspaceArtifactUrl(input) {
|
|
58
|
+
return `${workspaceArtifactRoutePrefix}${encodeURIComponent(input.conversationId)}/artifacts/${input.artifactId}`;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writable-shape-query.d.ts","sourceRoot":"","sources":["../../src/shared/writable-shape-query.ts"],"names":[],"mappings":"AAUA,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,MAAM,CAa/E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { sh, shaclGraphIri, writeLifecycle } from "./rdf-namespaces.js";
|
|
2
|
+
import { DataFactory } from "ldkit/rdf";
|
|
3
|
+
import { SELECT } from "ldkit/sparql";
|
|
4
|
+
const dataFactory = new DataFactory();
|
|
5
|
+
const property = dataFactory.namedNode(sh.property);
|
|
6
|
+
const node = dataFactory.namedNode(sh.node);
|
|
7
|
+
const path = dataFactory.namedNode(sh.path);
|
|
8
|
+
const lifecycle = dataFactory.namedNode(writeLifecycle.predicate);
|
|
9
|
+
export function buildActionShapePropertyQuery(actionShapeIris) {
|
|
10
|
+
const actionShapes = actionShapeIris.map((iri) => dataFactory.namedNode(iri));
|
|
11
|
+
return SELECT `DISTINCT ?actionShape ?parent ?path ?node ?flag`.WHERE `
|
|
12
|
+
GRAPH ${dataFactory.namedNode(shaclGraphIri)} {
|
|
13
|
+
VALUES ?actionShape { ${actionShapes} }
|
|
14
|
+
?actionShape (${property}/${node})* ?parent .
|
|
15
|
+
?parent ${property} ?propertyShape .
|
|
16
|
+
?propertyShape ${path} ?path .
|
|
17
|
+
OPTIONAL { ?propertyShape ${node} ?node . }
|
|
18
|
+
OPTIONAL { ?propertyShape ${lifecycle} ?flag . }
|
|
19
|
+
}
|
|
20
|
+
`.build();
|
|
21
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { type JsonLdValue, type JsonLdNode, type JsonLdContext, type JsonLdDocument, type JsonLdGraphDocument, isJsonLdNode, isJsonLdDocument, isJsonLdGraphDocument, getJsonLdGraph, getNodeId, getNodeType, getNodeTypes, hasType, getStringValue, getNumberValue, getRefId, mergeJsonLdGraphs, } from "@manta-eu/rdf-lib/jsonld";
|
|
2
|
+
//# sourceMappingURL=jsonld.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonld.d.ts","sourceRoot":"","sources":["../../src/types/jsonld.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,WAAW,EACX,YAAY,EACZ,OAAO,EACP,cAAc,EACd,cAAc,EACd,QAAQ,EACR,iBAAiB,GAClB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isJsonLdNode, isJsonLdDocument, isJsonLdGraphDocument, getJsonLdGraph, getNodeId, getNodeType, getNodeTypes, hasType, getStringValue, getNumberValue, getRefId, mergeJsonLdGraphs, } from "@manta-eu/rdf-lib/jsonld";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { SparqlValue, SparqlBinding, SparqlJsonResults, SparqlAskResult } from "@manta-eu/ldo/sparql-types";
|
|
2
|
+
export { isSparqlAskResult, isSparqlValue, isSparqlBinding, isSparqlJsonResults, validateSparqlAskResult, validateSparqlJsonResults, } from "@manta-eu/ldo/sparql-types";
|
|
3
|
+
//# sourceMappingURL=sparql-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparql-types.d.ts","sourceRoot":"","sources":["../../src/types/sparql-types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEjH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isSparqlAskResult, isSparqlValue, isSparqlBinding, isSparqlJsonResults, validateSparqlAskResult, validateSparqlJsonResults, } from "@manta-eu/ldo/sparql-types";
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@manta-eu/client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The Manta GraphQL contract and the typed React Query hooks generated from it",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./shared/tools": {
|
|
12
|
+
"types": "./dist/shared/tools/index.d.ts",
|
|
13
|
+
"import": "./dist/shared/tools/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./shared/*": {
|
|
16
|
+
"types": "./dist/shared/*.d.ts",
|
|
17
|
+
"import": "./dist/shared/*.js"
|
|
18
|
+
},
|
|
19
|
+
"./types/*": {
|
|
20
|
+
"types": "./dist/types/*.d.ts",
|
|
21
|
+
"import": "./dist/types/*.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"author": "",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"ai": "7.0.98",
|
|
34
|
+
"graphql": "^16.13.1",
|
|
35
|
+
"graphql-request": "^7.3.1",
|
|
36
|
+
"hono": "^4.9.8",
|
|
37
|
+
"iso8601-duration": "^2.1.3",
|
|
38
|
+
"ldkit": "2.8.0",
|
|
39
|
+
"mime": "^4.1.0",
|
|
40
|
+
"ramda": "^0.32.0",
|
|
41
|
+
"ts-pattern": "^5.8.0",
|
|
42
|
+
"uuid": "^13.0.0",
|
|
43
|
+
"whatwg-mimetype": "^5.0.0",
|
|
44
|
+
"zod": "^4.5.0",
|
|
45
|
+
"@manta-eu/ldo": "0.1.0",
|
|
46
|
+
"@manta-eu/lib": "0.1.0",
|
|
47
|
+
"@manta-eu/rdf-lib": "0.1.0",
|
|
48
|
+
"@manta-eu/datalog-parser": "0.1.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@tanstack/react-query": "^5.100.10",
|
|
52
|
+
"react": "^19.2.3",
|
|
53
|
+
"react-router": "^7.9.6"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@graphql-codegen/cli": "^6.0.0",
|
|
57
|
+
"@graphql-codegen/typescript": "^5.0.0",
|
|
58
|
+
"@graphql-codegen/typescript-operations": "^5.0.0",
|
|
59
|
+
"@graphql-codegen/typescript-react-query": "^6.1.1",
|
|
60
|
+
"@types/ramda": "^0.31.1",
|
|
61
|
+
"@types/react": "^19.2.7",
|
|
62
|
+
"@types/whatwg-mimetype": "^5.0.0",
|
|
63
|
+
"prettier": "^3.6.2",
|
|
64
|
+
"react": "^19.2.3",
|
|
65
|
+
"react-router": "^7.9.6",
|
|
66
|
+
"tsc-alias": "^1.9.5",
|
|
67
|
+
"typescript": "^5.9.3",
|
|
68
|
+
"vitest": "^3.0.0"
|
|
69
|
+
},
|
|
70
|
+
"prettier": {
|
|
71
|
+
"printWidth": 120,
|
|
72
|
+
"trailingComma": "all"
|
|
73
|
+
},
|
|
74
|
+
"imports": {
|
|
75
|
+
"#*": {
|
|
76
|
+
"manta-source": [
|
|
77
|
+
"./src/*",
|
|
78
|
+
"./src/*.ts",
|
|
79
|
+
"./src/*.tsx",
|
|
80
|
+
"./src/*/index.ts",
|
|
81
|
+
"./src/*/index.tsx"
|
|
82
|
+
],
|
|
83
|
+
"types": "./dist/*.d.ts",
|
|
84
|
+
"default": "./dist/*.js"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"build": "graphql-codegen -c codegen.ts && tsc --project tsconfig.build.json && tsc-alias --project tsconfig.build.json --resolve-full-paths",
|
|
89
|
+
"types": "tsc --noEmit",
|
|
90
|
+
"test": "vitest --run --passWithNoTests",
|
|
91
|
+
"check": "./verify-generated.sh"
|
|
92
|
+
}
|
|
93
|
+
}
|