@dxos/assistant 0.8.1 → 0.8.2-main.10c050d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +1830 -228
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +1825 -229
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +1831 -228
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/{src/bin → bin}/chat.d.ts.map +1 -1
- package/dist/types/src/blueprint/blueprint.d.ts +79 -0
- package/dist/types/src/blueprint/blueprint.d.ts.map +1 -0
- package/dist/types/src/blueprint/blueprint.test.d.ts +2 -0
- package/dist/types/src/blueprint/blueprint.test.d.ts.map +1 -0
- package/dist/types/src/blueprint/index.d.ts +4 -0
- package/dist/types/src/blueprint/index.d.ts.map +1 -0
- package/dist/types/src/blueprint/logger.d.ts +3 -0
- package/dist/types/src/blueprint/logger.d.ts.map +1 -0
- package/dist/types/src/blueprint/machine.d.ts +113 -0
- package/dist/types/src/blueprint/machine.d.ts.map +1 -0
- package/dist/types/src/blueprint/test-data.d.ts +3 -0
- package/dist/types/src/blueprint/test-data.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +4 -0
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +2 -0
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts +2 -0
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +210 -0
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +2 -0
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-ner-function/index.d.ts +3 -0
- package/dist/types/src/extraction/extraction-ner-function/index.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts +14 -0
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.test.d.ts +2 -0
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.test.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction.d.ts +242 -0
- package/dist/types/src/extraction/extraction.d.ts.map +1 -0
- package/dist/types/src/extraction/index.d.ts +5 -0
- package/dist/types/src/extraction/index.d.ts.map +1 -0
- package/dist/types/src/extraction/quotes.d.ts +15 -0
- package/dist/types/src/extraction/quotes.d.ts.map +1 -0
- package/dist/types/src/extraction/quotes.test.d.ts +2 -0
- package/dist/types/src/extraction/quotes.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/research/exa.d.ts +7 -0
- package/dist/types/src/research/exa.d.ts.map +1 -0
- package/dist/types/src/research/graph.d.ts +39 -0
- package/dist/types/src/research/graph.d.ts.map +1 -0
- package/dist/types/src/research/graph.test.d.ts +2 -0
- package/dist/types/src/research/graph.test.d.ts.map +1 -0
- package/dist/types/src/research/index.d.ts +4 -0
- package/dist/types/src/research/index.d.ts.map +1 -0
- package/dist/types/src/research/research.d.ts +10 -0
- package/dist/types/src/research/research.d.ts.map +1 -0
- package/dist/types/src/research/research.test.d.ts +2 -0
- package/dist/types/src/research/research.test.d.ts.map +1 -0
- package/dist/types/src/session/index.d.ts +1 -0
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/session.d.ts +80 -35
- package/dist/types/src/session/session.d.ts.map +1 -1
- package/dist/types/src/session/version-pin.d.ts +21 -0
- package/dist/types/src/session/version-pin.d.ts.map +1 -0
- package/dist/types/src/session/version-pin.test.d.ts +2 -0
- package/dist/types/src/session/version-pin.test.d.ts.map +1 -0
- package/dist/types/src/summarization/summarization.test.d.ts +2 -0
- package/dist/types/src/summarization/summarization.test.d.ts.map +1 -0
- package/dist/types/src/testing/exa-search-1748337321991.d.ts +38 -0
- package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +1 -0
- package/dist/types/src/testing/exa-search-1748337331526.d.ts +37 -0
- package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +1 -0
- package/dist/types/src/testing/exa-search-1748337344119.d.ts +58 -0
- package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -6
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +3 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -35
- package/src/blueprint/blueprint.test.ts +142 -0
- package/src/blueprint/blueprint.ts +95 -0
- package/src/blueprint/index.ts +7 -0
- package/src/blueprint/logger.ts +66 -0
- package/src/blueprint/machine.ts +208 -0
- package/src/blueprint/test-data.ts +55 -0
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +95 -0
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +64 -0
- package/src/extraction/extraction-llm-function/index.ts +5 -0
- package/src/extraction/extraction-llm-function/instructions.tpl +28 -0
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +115 -0
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +54 -0
- package/src/extraction/extraction-ner-function/index.ts +6 -0
- package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +94 -0
- package/src/extraction/extraction-ner-function/named-entity-recognition.ts +97 -0
- package/src/extraction/extraction.ts +75 -0
- package/src/extraction/index.ts +8 -0
- package/src/extraction/quotes.test.ts +27 -0
- package/src/extraction/quotes.ts +57 -0
- package/src/index.ts +4 -3
- package/src/research/exa.ts +100 -0
- package/src/research/graph.test.ts +15 -0
- package/src/research/graph.ts +291 -0
- package/src/research/index.ts +7 -0
- package/src/research/instructions-research.tpl +97 -0
- package/src/research/research.test.ts +189 -0
- package/src/research/research.ts +89 -0
- package/src/session/index.ts +1 -0
- package/src/session/session.test.ts +39 -67
- package/src/session/session.ts +328 -155
- package/src/session/version-pin.test.ts +26 -0
- package/src/session/version-pin.ts +48 -0
- package/src/summarization/summarization.test.ts +216 -0
- package/src/testing/exa-search-1748337321991.ts +131 -0
- package/src/testing/exa-search-1748337331526.ts +144 -0
- package/src/testing/exa-search-1748337344119.ts +133 -0
- package/src/testing/index.ts +8 -7
- package/src/typedefs.d.ts +8 -0
- package/src/types.ts +8 -0
- package/src/typings.d.ts +8 -0
- package/dist/lib/browser/chunk-PND5VR6D.mjs +0 -2315
- package/dist/lib/browser/chunk-PND5VR6D.mjs.map +0 -7
- package/dist/lib/browser/testing/index.mjs +0 -621
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node/chunk-IBOBRBDF.cjs +0 -2326
- package/dist/lib/node/chunk-IBOBRBDF.cjs.map +0 -7
- package/dist/lib/node/testing/index.cjs +0 -637
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-DCQJOLSR.mjs +0 -2317
- package/dist/lib/node-esm/chunk-DCQJOLSR.mjs.map +0 -7
- package/dist/lib/node-esm/testing/index.mjs +0 -622
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/ai-service/client.test.d.ts +0 -2
- package/dist/types/src/ai-service/client.test.d.ts.map +0 -1
- package/dist/types/src/ai-service/defs.d.ts +0 -9
- package/dist/types/src/ai-service/defs.d.ts.map +0 -1
- package/dist/types/src/ai-service/edge-client.d.ts +0 -19
- package/dist/types/src/ai-service/edge-client.d.ts.map +0 -1
- package/dist/types/src/ai-service/index.d.ts +0 -10
- package/dist/types/src/ai-service/index.d.ts.map +0 -1
- package/dist/types/src/ai-service/message-collector.d.ts +0 -88
- package/dist/types/src/ai-service/message-collector.d.ts.map +0 -1
- package/dist/types/src/ai-service/ollama-client.d.ts +0 -39
- package/dist/types/src/ai-service/ollama-client.d.ts.map +0 -1
- package/dist/types/src/ai-service/parser.d.ts +0 -138
- package/dist/types/src/ai-service/parser.d.ts.map +0 -1
- package/dist/types/src/ai-service/service.d.ts +0 -9
- package/dist/types/src/ai-service/service.d.ts.map +0 -1
- package/dist/types/src/ai-service/stream.d.ts +0 -40
- package/dist/types/src/ai-service/stream.d.ts.map +0 -1
- package/dist/types/src/ai-service/stream.test.d.ts +0 -2
- package/dist/types/src/ai-service/stream.test.d.ts.map +0 -1
- package/dist/types/src/ai-service/testing/index.d.ts +0 -3
- package/dist/types/src/ai-service/testing/index.d.ts.map +0 -1
- package/dist/types/src/ai-service/testing/mock.d.ts +0 -7
- package/dist/types/src/ai-service/testing/mock.d.ts.map +0 -1
- package/dist/types/src/ai-service/testing/test-stream.d.ts +0 -7
- package/dist/types/src/ai-service/testing/test-stream.d.ts.map +0 -1
- package/dist/types/src/ai-service/transform.d.ts +0 -27
- package/dist/types/src/ai-service/transform.d.ts.map +0 -1
- package/dist/types/src/ai-service/types.d.ts +0 -167
- package/dist/types/src/ai-service/types.d.ts.map +0 -1
- package/dist/types/src/ai-service/util/index.d.ts +0 -2
- package/dist/types/src/ai-service/util/index.d.ts.map +0 -1
- package/dist/types/src/ai-service/util/sse.d.ts +0 -39
- package/dist/types/src/ai-service/util/sse.d.ts.map +0 -1
- package/dist/types/src/conversation/conversation.d.ts +0 -80
- package/dist/types/src/conversation/conversation.d.ts.map +0 -1
- package/dist/types/src/conversation/conversation.test.d.ts +0 -2
- package/dist/types/src/conversation/conversation.test.d.ts.map +0 -1
- package/dist/types/src/conversation/index.d.ts +0 -2
- package/dist/types/src/conversation/index.d.ts.map +0 -1
- package/dist/types/src/conversation/types.d.ts +0 -79
- package/dist/types/src/conversation/types.d.ts.map +0 -1
- package/dist/types/src/cypher/ast.d.ts +0 -56
- package/dist/types/src/cypher/ast.d.ts.map +0 -1
- package/dist/types/src/cypher/combinators.d.ts +0 -14
- package/dist/types/src/cypher/combinators.d.ts.map +0 -1
- package/dist/types/src/cypher/combinators.test.d.ts +0 -2
- package/dist/types/src/cypher/combinators.test.d.ts.map +0 -1
- package/dist/types/src/cypher/echo-data-source.d.ts +0 -16
- package/dist/types/src/cypher/echo-data-source.d.ts.map +0 -1
- package/dist/types/src/cypher/execution-plan.d.ts +0 -49
- package/dist/types/src/cypher/execution-plan.d.ts.map +0 -1
- package/dist/types/src/cypher/execution-plan.test.d.ts +0 -2
- package/dist/types/src/cypher/execution-plan.test.d.ts.map +0 -1
- package/dist/types/src/cypher/index.d.ts +0 -5
- package/dist/types/src/cypher/index.d.ts.map +0 -1
- package/dist/types/src/cypher/parjs.d.ts +0 -4
- package/dist/types/src/cypher/parjs.d.ts.map +0 -1
- package/dist/types/src/cypher/parser.d.ts +0 -6
- package/dist/types/src/cypher/parser.d.ts.map +0 -1
- package/dist/types/src/cypher/query-executor.d.ts +0 -26
- package/dist/types/src/cypher/query-executor.d.ts.map +0 -1
- package/dist/types/src/cypher/query-executor.test.d.ts +0 -2
- package/dist/types/src/cypher/query-executor.test.d.ts.map +0 -1
- package/dist/types/src/cypher/schema.d.ts +0 -12
- package/dist/types/src/cypher/schema.d.ts.map +0 -1
- package/dist/types/src/cypher/schema.test.d.ts +0 -2
- package/dist/types/src/cypher/schema.test.d.ts.map +0 -1
- package/dist/types/src/testing/artifacts.test.d.ts +0 -1
- package/dist/types/src/testing/artifacts.test.d.ts.map +0 -1
- package/dist/types/src/testing/data.d.ts +0 -2
- package/dist/types/src/testing/data.d.ts.map +0 -1
- package/dist/types/src/testing/defs.d.ts +0 -5
- package/dist/types/src/testing/defs.d.ts.map +0 -1
- package/dist/types/src/testing/logger.d.ts +0 -12
- package/dist/types/src/testing/logger.d.ts.map +0 -1
- package/dist/types/src/testing/object-extraction.test.d.ts +0 -1
- package/dist/types/src/testing/object-extraction.test.d.ts.map +0 -1
- package/dist/types/src/testing/ollama.d.ts +0 -6
- package/dist/types/src/testing/ollama.d.ts.map +0 -1
- package/dist/types/src/testing/query-promts.d.ts +0 -5
- package/dist/types/src/testing/query-promts.d.ts.map +0 -1
- package/dist/types/src/testing/query.test.d.ts +0 -2
- package/dist/types/src/testing/query.test.d.ts.map +0 -1
- package/dist/types/src/testing/test-data.d.ts +0 -29
- package/dist/types/src/testing/test-data.d.ts.map +0 -1
- package/dist/types/src/testing/test-schema.d.ts +0 -50
- package/dist/types/src/testing/test-schema.d.ts.map +0 -1
- package/dist/types/src/util/index.d.ts +0 -2
- package/dist/types/src/util/index.d.ts.map +0 -1
- package/dist/types/src/util/trim.d.ts +0 -5
- package/dist/types/src/util/trim.d.ts.map +0 -1
- package/src/ai-service/client.test.ts +0 -265
- package/src/ai-service/defs.ts +0 -39
- package/src/ai-service/edge-client.ts +0 -67
- package/src/ai-service/index.ts +0 -13
- package/src/ai-service/message-collector.ts +0 -84
- package/src/ai-service/ollama-client.ts +0 -499
- package/src/ai-service/parser.ts +0 -358
- package/src/ai-service/service.ts +0 -15
- package/src/ai-service/stream.test.ts +0 -125
- package/src/ai-service/stream.ts +0 -118
- package/src/ai-service/testing/index.ts +0 -6
- package/src/ai-service/testing/mock.ts +0 -22
- package/src/ai-service/testing/test-stream.ts +0 -93
- package/src/ai-service/transform.ts +0 -121
- package/src/ai-service/types.ts +0 -103
- package/src/ai-service/util/index.ts +0 -5
- package/src/ai-service/util/sse.ts +0 -341
- package/src/bin/chat.ts +0 -79
- package/src/conversation/conversation.test.ts +0 -73
- package/src/conversation/conversation.ts +0 -257
- package/src/conversation/index.ts +0 -5
- package/src/conversation/types.ts +0 -129
- package/src/cypher/ast.ts +0 -75
- package/src/cypher/combinators.test.ts +0 -137
- package/src/cypher/combinators.ts +0 -148
- package/src/cypher/echo-data-source.ts +0 -105
- package/src/cypher/execution-plan.test.ts +0 -44
- package/src/cypher/execution-plan.ts +0 -208
- package/src/cypher/index.ts +0 -8
- package/src/cypher/parjs-shims.d.ts +0 -10
- package/src/cypher/parjs.ts +0 -10
- package/src/cypher/parser.ts +0 -19
- package/src/cypher/query-executor.test.ts +0 -47
- package/src/cypher/query-executor.ts +0 -145
- package/src/cypher/schema.test.ts +0 -17
- package/src/cypher/schema.ts +0 -86
- package/src/testing/artifacts.test.ts +0 -182
- package/src/testing/data.ts +0 -13
- package/src/testing/defs.ts +0 -9
- package/src/testing/logger.ts +0 -129
- package/src/testing/object-extraction.test.ts +0 -71
- package/src/testing/ollama.ts +0 -15
- package/src/testing/query-promts.ts +0 -75
- package/src/testing/query.test.ts +0 -91
- package/src/testing/test-data.ts +0 -372
- package/src/testing/test-schema.ts +0 -80
- package/src/util/index.ts +0 -5
- package/src/util/trim.ts +0 -15
- package/vendor/parjs-browser.mjs +0 -4
- package/vendor/parjs-default.mjs +0 -8
- /package/dist/types/{src/bin → bin}/chat.d.ts +0 -0
|
@@ -1,637 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var testing_exports = {};
|
|
20
|
-
__export(testing_exports, {
|
|
21
|
-
AI_SERVICE_ENDPOINT: () => AI_SERVICE_ENDPOINT,
|
|
22
|
-
Contact: () => Contact,
|
|
23
|
-
MockDataSource: () => MockDataSource,
|
|
24
|
-
ObjectId: () => ObjectId2,
|
|
25
|
-
Org: () => Org,
|
|
26
|
-
Project: () => Project,
|
|
27
|
-
Task: () => Task,
|
|
28
|
-
createCypherTool: () => createCypherTool,
|
|
29
|
-
createLogger: () => createLogger,
|
|
30
|
-
createSystemPrompt: () => createSystemPrompt,
|
|
31
|
-
createTestData: () => createTestData,
|
|
32
|
-
createTestOllamaClient: () => createTestOllamaClient,
|
|
33
|
-
seedTestData: () => seedTestData
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(testing_exports);
|
|
36
|
-
var import_chunk_IBOBRBDF = require("../chunk-IBOBRBDF.cjs");
|
|
37
|
-
var import_effect = require("effect");
|
|
38
|
-
var import_artifact = require("@dxos/artifact");
|
|
39
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
40
|
-
var import_log = require("@dxos/log");
|
|
41
|
-
var import_debug = require("@dxos/debug");
|
|
42
|
-
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
43
|
-
var import_invariant = require("@dxos/invariant");
|
|
44
|
-
var import_live_object = require("@dxos/live-object");
|
|
45
|
-
var import_effect2 = require("effect");
|
|
46
|
-
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
47
|
-
var AI_SERVICE_ENDPOINT = {
|
|
48
|
-
LOCAL: "http://localhost:8788",
|
|
49
|
-
REMOTE: "https://ai-service.dxos.workers.dev"
|
|
50
|
-
};
|
|
51
|
-
var createLogger = ({ stream, filter, onImage } = {}) => {
|
|
52
|
-
const images = {};
|
|
53
|
-
let currentText = "";
|
|
54
|
-
return (event) => {
|
|
55
|
-
if (typeof filter === "function" && !filter(event)) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const printContentBlock = (content) => {
|
|
59
|
-
switch (content.type) {
|
|
60
|
-
case "text":
|
|
61
|
-
process.stdout.write(content.text);
|
|
62
|
-
break;
|
|
63
|
-
case "tool_use":
|
|
64
|
-
process.stdout.write(`\u2699\uFE0F [Tool Use] ${content.name}
|
|
65
|
-
`);
|
|
66
|
-
break;
|
|
67
|
-
case "image": {
|
|
68
|
-
if (content.id && content.source) {
|
|
69
|
-
images[content.id] = content.source;
|
|
70
|
-
}
|
|
71
|
-
process.stdout.write(`[Image id=${content.id} mediaType=${content.source?.mediaType}]`);
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const onTextBlockPrinted = (text) => {
|
|
77
|
-
const imageMatch = text.match(/<image id="([^"]+)"(?:\s+prompt="([^"]+)")?\s*\/>/);
|
|
78
|
-
if (imageMatch && onImage && images[imageMatch[1]]) {
|
|
79
|
-
onImage({
|
|
80
|
-
id: imageMatch[1],
|
|
81
|
-
description: imageMatch[2],
|
|
82
|
-
source: images[imageMatch[1]]
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
if (stream) {
|
|
87
|
-
switch (event.type) {
|
|
88
|
-
case "message_start": {
|
|
89
|
-
process.stdout.write(`${event.message.role.toUpperCase()}
|
|
90
|
-
|
|
91
|
-
`);
|
|
92
|
-
for (const content of event.message.content) {
|
|
93
|
-
printContentBlock(content);
|
|
94
|
-
}
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
case "content_block_start": {
|
|
98
|
-
currentText = "";
|
|
99
|
-
printContentBlock(event.content);
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
case "content_block_delta": {
|
|
103
|
-
switch (event.delta.type) {
|
|
104
|
-
case "text_delta": {
|
|
105
|
-
currentText += event.delta.text;
|
|
106
|
-
process.stdout.write(event.delta.text);
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
case "input_json_delta": {
|
|
110
|
-
process.stdout.write(event.delta.partial_json);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
case "content_block_stop": {
|
|
117
|
-
process.stdout.write("\n");
|
|
118
|
-
onTextBlockPrinted(currentText);
|
|
119
|
-
currentText = "";
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
case "message_delta": {
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
case "message_stop": {
|
|
126
|
-
process.stdout.write("\n\n");
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
switch (event.type) {
|
|
132
|
-
case "message": {
|
|
133
|
-
if (!stream || event.message.role !== "assistant") {
|
|
134
|
-
process.stdout.write(`${event.message.role.toUpperCase()}
|
|
135
|
-
|
|
136
|
-
`);
|
|
137
|
-
for (const block of event.message.content) {
|
|
138
|
-
switch (block.type) {
|
|
139
|
-
case "text":
|
|
140
|
-
process.stdout.write(block.text + "\n");
|
|
141
|
-
onTextBlockPrinted(block.text);
|
|
142
|
-
break;
|
|
143
|
-
case "tool_use":
|
|
144
|
-
process.stdout.write(`\u2699\uFE0F [Tool Use] ${block.name}
|
|
145
|
-
`);
|
|
146
|
-
process.stdout.write(` ${JSON.stringify(block.input)}
|
|
147
|
-
`);
|
|
148
|
-
break;
|
|
149
|
-
case "tool_result":
|
|
150
|
-
if (block.isError) {
|
|
151
|
-
process.stdout.write("\u274C [Tool Error]\n");
|
|
152
|
-
process.stdout.write(block.content + "\n");
|
|
153
|
-
} else {
|
|
154
|
-
process.stdout.write("\u2705 [Tool Success]\n");
|
|
155
|
-
process.stdout.write(block.content + "\n");
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
process.stdout.write("\n\n");
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
var createTestOllamaClient = (options) => {
|
|
167
|
-
return new import_chunk_IBOBRBDF.OllamaClient({
|
|
168
|
-
tools: options?.tools,
|
|
169
|
-
overrides: {
|
|
170
|
-
model: import_chunk_IBOBRBDF.DEFAULT_OLLAMA_MODEL,
|
|
171
|
-
temperature: 0
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
};
|
|
175
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/experimental/assistant/src/testing/query-promts.ts";
|
|
176
|
-
var createCypherTool = (dataSource, schemaTypes = []) => (0, import_artifact.defineTool)("dxos.org/echo", {
|
|
177
|
-
name: "query",
|
|
178
|
-
description: "Query the ECHO graph database in cypher query language. Returns data from the database." + (schemaTypes.length > 0 ? `
|
|
179
|
-
|
|
180
|
-
${createSystemPrompt(schemaTypes)}` : ""),
|
|
181
|
-
schema: import_effect.Schema.Struct({
|
|
182
|
-
query: import_effect.Schema.String.annotations({
|
|
183
|
-
description: `
|
|
184
|
-
A valid cypher query string to execute.
|
|
185
|
-
Query must have one MATCH clause.
|
|
186
|
-
Match clause can have multiple patterns but they must all be connected via a relationship chain.
|
|
187
|
-
Query might have zero or one WHERE clauses.
|
|
188
|
-
Query must have one RETURN clause.
|
|
189
|
-
RETURN clause can have multiple expressions separated by commas.
|
|
190
|
-
DISTINCT keyword is not allowed.
|
|
191
|
-
|
|
192
|
-
<example>
|
|
193
|
-
MATCH (n:Person) RETURN n.name
|
|
194
|
-
</example>
|
|
195
|
-
|
|
196
|
-
<example>
|
|
197
|
-
MATCH (s:Studio)-[:PRODUCED]->(m:Movie)-[:PRODUCED_IN]->(c:City {name: "Las Vegas"}) RETURN s
|
|
198
|
-
</example>
|
|
199
|
-
|
|
200
|
-
<example>
|
|
201
|
-
MATCH (a:Actor)-[:STARRED_IN]->(m:Movie)<-[:PRODUCED]-(s:Studio {name: "Cinema Pictures"}) WHERE m.name = "Once upon a time" RETURN m.name, a.name
|
|
202
|
-
</example>
|
|
203
|
-
`
|
|
204
|
-
})
|
|
205
|
-
}),
|
|
206
|
-
execute: async ({ query }) => {
|
|
207
|
-
try {
|
|
208
|
-
(0, import_log.log)("cypher query", {
|
|
209
|
-
query
|
|
210
|
-
}, {
|
|
211
|
-
F: __dxlog_file,
|
|
212
|
-
L: 47,
|
|
213
|
-
S: void 0,
|
|
214
|
-
C: (f, a) => f(...a)
|
|
215
|
-
});
|
|
216
|
-
const results = await (0, import_chunk_IBOBRBDF.executeQuery)(dataSource, query);
|
|
217
|
-
(0, import_log.log)("query complete", {
|
|
218
|
-
results
|
|
219
|
-
}, {
|
|
220
|
-
F: __dxlog_file,
|
|
221
|
-
L: 49,
|
|
222
|
-
S: void 0,
|
|
223
|
-
C: (f, a) => f(...a)
|
|
224
|
-
});
|
|
225
|
-
return import_artifact.ToolResult.Success(results);
|
|
226
|
-
} catch (e) {
|
|
227
|
-
import_log.log.catch(e, void 0, {
|
|
228
|
-
F: __dxlog_file,
|
|
229
|
-
L: 52,
|
|
230
|
-
S: void 0,
|
|
231
|
-
C: (f, a) => f(...a)
|
|
232
|
-
});
|
|
233
|
-
return import_artifact.ToolResult.Error(e.message);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
var createSystemPrompt = (schemaTypes) => import_chunk_IBOBRBDF.trim`
|
|
238
|
-
You have access to ECHO graph database. You can query the database to get data to satisfy user prompts.
|
|
239
|
-
|
|
240
|
-
Database schema is defined in pseud-cypher syntax. The schema is:
|
|
241
|
-
|
|
242
|
-
<schema>
|
|
243
|
-
${(0, import_chunk_IBOBRBDF.formatJsonSchemaForLLM)(schemaTypes.map((schema) => (0, import_echo_schema.toJsonSchema)(schema)))}
|
|
244
|
-
<schema>
|
|
245
|
-
|
|
246
|
-
Before replying always think step-by-step on how to proceed.
|
|
247
|
-
Print your thoughts inside <cot> tags.
|
|
248
|
-
|
|
249
|
-
<example>
|
|
250
|
-
<cot>To answer the question I need to ...</cot>
|
|
251
|
-
</example>
|
|
252
|
-
|
|
253
|
-
Before answering the user's question, decide what tools you need to use to answer the question.
|
|
254
|
-
`;
|
|
255
|
-
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/experimental/assistant/src/testing/test-data.ts";
|
|
256
|
-
var seedTestData = (db) => {
|
|
257
|
-
const contactRich = db.add((0, import_live_object.create)(Contact, {
|
|
258
|
-
name: "Rich"
|
|
259
|
-
}));
|
|
260
|
-
const contactJosiah = db.add((0, import_live_object.create)(Contact, {
|
|
261
|
-
name: "Josiah"
|
|
262
|
-
}));
|
|
263
|
-
const contactDima = db.add((0, import_live_object.create)(Contact, {
|
|
264
|
-
name: "Dima"
|
|
265
|
-
}));
|
|
266
|
-
const contactFred = db.add((0, import_live_object.create)(Contact, {
|
|
267
|
-
name: "Fred"
|
|
268
|
-
}));
|
|
269
|
-
const projectComposer = db.add((0, import_live_object.create)(Project, {
|
|
270
|
-
name: "Composer"
|
|
271
|
-
}));
|
|
272
|
-
const projectEcho = db.add((0, import_live_object.create)(Project, {
|
|
273
|
-
name: "ECHO"
|
|
274
|
-
}));
|
|
275
|
-
const projectDoodles = db.add((0, import_live_object.create)(Project, {
|
|
276
|
-
name: "Doodles"
|
|
277
|
-
}));
|
|
278
|
-
const _taskComposer1 = db.add((0, import_live_object.create)(Task, {
|
|
279
|
-
name: "Optimize startup performance",
|
|
280
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
281
|
-
assignee: (0, import_live_object.makeRef)(contactJosiah)
|
|
282
|
-
}));
|
|
283
|
-
const _taskComposer2 = db.add((0, import_live_object.create)(Task, {
|
|
284
|
-
name: "Create form builder",
|
|
285
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
286
|
-
assignee: (0, import_live_object.makeRef)(contactRich)
|
|
287
|
-
}));
|
|
288
|
-
const _taskComposer3 = db.add((0, import_live_object.create)(Task, {
|
|
289
|
-
name: "Add support for custom themes",
|
|
290
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
291
|
-
assignee: (0, import_live_object.makeRef)(contactJosiah)
|
|
292
|
-
}));
|
|
293
|
-
const _taskComposer5 = db.add((0, import_live_object.create)(Task, {
|
|
294
|
-
name: "Implement community plugin",
|
|
295
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
296
|
-
assignee: (0, import_live_object.makeRef)(contactFred)
|
|
297
|
-
}));
|
|
298
|
-
const _taskComposer4 = db.add((0, import_live_object.create)(Task, {
|
|
299
|
-
name: "Implement dark mode",
|
|
300
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
301
|
-
assignee: (0, import_live_object.makeRef)(contactRich)
|
|
302
|
-
}));
|
|
303
|
-
const _taskEcho1 = db.add((0, import_live_object.create)(Task, {
|
|
304
|
-
name: "Implement cypher query engine",
|
|
305
|
-
project: (0, import_live_object.makeRef)(projectEcho),
|
|
306
|
-
assignee: (0, import_live_object.makeRef)(contactDima)
|
|
307
|
-
}));
|
|
308
|
-
const _taskEcho2 = db.add((0, import_live_object.create)(Task, {
|
|
309
|
-
name: "Add schema editor",
|
|
310
|
-
project: (0, import_live_object.makeRef)(projectEcho),
|
|
311
|
-
assignee: (0, import_live_object.makeRef)(contactRich)
|
|
312
|
-
}));
|
|
313
|
-
const _taskDoodles1 = db.add((0, import_live_object.create)(Task, {
|
|
314
|
-
name: "Add support for custom themes",
|
|
315
|
-
project: (0, import_live_object.makeRef)(projectDoodles),
|
|
316
|
-
assignee: (0, import_live_object.makeRef)(contactFred)
|
|
317
|
-
}));
|
|
318
|
-
const _taskDoodles2 = db.add((0, import_live_object.create)(Task, {
|
|
319
|
-
name: "Implement dark mode",
|
|
320
|
-
project: (0, import_live_object.makeRef)(projectDoodles),
|
|
321
|
-
assignee: (0, import_live_object.makeRef)(contactJosiah)
|
|
322
|
-
}));
|
|
323
|
-
const _orgDxos = db.add((0, import_live_object.create)(Org, {
|
|
324
|
-
name: "DXOS",
|
|
325
|
-
employees: [
|
|
326
|
-
(0, import_live_object.makeRef)(contactRich),
|
|
327
|
-
(0, import_live_object.makeRef)(contactJosiah),
|
|
328
|
-
(0, import_live_object.makeRef)(contactDima)
|
|
329
|
-
],
|
|
330
|
-
projects: [
|
|
331
|
-
(0, import_live_object.makeRef)(projectEcho)
|
|
332
|
-
]
|
|
333
|
-
}));
|
|
334
|
-
const _orgBraneframe = db.add((0, import_live_object.create)(Org, {
|
|
335
|
-
name: "Braneframe",
|
|
336
|
-
employees: [
|
|
337
|
-
(0, import_live_object.makeRef)(contactJosiah),
|
|
338
|
-
(0, import_live_object.makeRef)(contactRich)
|
|
339
|
-
],
|
|
340
|
-
projects: [
|
|
341
|
-
(0, import_live_object.makeRef)(projectComposer)
|
|
342
|
-
]
|
|
343
|
-
}));
|
|
344
|
-
};
|
|
345
|
-
var createTestData = () => {
|
|
346
|
-
const dataSource = new MockDataSource();
|
|
347
|
-
const contactRich = dataSource.add(Contact, {
|
|
348
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
349
|
-
name: "Rich"
|
|
350
|
-
});
|
|
351
|
-
const contactJosiah = dataSource.add(Contact, {
|
|
352
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
353
|
-
name: "Josiah"
|
|
354
|
-
});
|
|
355
|
-
const contactDima = dataSource.add(Contact, {
|
|
356
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
357
|
-
name: "Dima"
|
|
358
|
-
});
|
|
359
|
-
const contactFred = dataSource.add(Contact, {
|
|
360
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
361
|
-
name: "Fred"
|
|
362
|
-
});
|
|
363
|
-
const projectComposer = dataSource.add(Project, {
|
|
364
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
365
|
-
name: "Composer"
|
|
366
|
-
});
|
|
367
|
-
const projectEcho = dataSource.add(Project, {
|
|
368
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
369
|
-
name: "ECHO"
|
|
370
|
-
});
|
|
371
|
-
const projectDoodles = dataSource.add(Project, {
|
|
372
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
373
|
-
name: "Doodles"
|
|
374
|
-
});
|
|
375
|
-
const _taskComposer1 = dataSource.add(Task, {
|
|
376
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
377
|
-
name: "Optimize startup performance",
|
|
378
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
379
|
-
assignee: (0, import_live_object.makeRef)(contactJosiah)
|
|
380
|
-
});
|
|
381
|
-
const _taskComposer2 = dataSource.add(Task, {
|
|
382
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
383
|
-
name: "Create form builder",
|
|
384
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
385
|
-
assignee: (0, import_live_object.makeRef)(contactRich)
|
|
386
|
-
});
|
|
387
|
-
const _taskComposer3 = dataSource.add(Task, {
|
|
388
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
389
|
-
name: "Add support for custom themes",
|
|
390
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
391
|
-
assignee: (0, import_live_object.makeRef)(contactJosiah)
|
|
392
|
-
});
|
|
393
|
-
const _taskComposer5 = dataSource.add(Task, {
|
|
394
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
395
|
-
name: "Implement community plugin",
|
|
396
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
397
|
-
assignee: (0, import_live_object.makeRef)(contactFred)
|
|
398
|
-
});
|
|
399
|
-
const _taskComposer4 = dataSource.add(Task, {
|
|
400
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
401
|
-
name: "Implement dark mode",
|
|
402
|
-
project: (0, import_live_object.makeRef)(projectComposer),
|
|
403
|
-
assignee: (0, import_live_object.makeRef)(contactRich)
|
|
404
|
-
});
|
|
405
|
-
const _taskEcho1 = dataSource.add(Task, {
|
|
406
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
407
|
-
name: "Implement cypher query engine",
|
|
408
|
-
project: (0, import_live_object.makeRef)(projectEcho),
|
|
409
|
-
assignee: (0, import_live_object.makeRef)(contactDima)
|
|
410
|
-
});
|
|
411
|
-
const _taskEcho2 = dataSource.add(Task, {
|
|
412
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
413
|
-
name: "Add schema editor",
|
|
414
|
-
project: (0, import_live_object.makeRef)(projectEcho),
|
|
415
|
-
assignee: (0, import_live_object.makeRef)(contactRich)
|
|
416
|
-
});
|
|
417
|
-
const _taskDoodles1 = dataSource.add(Task, {
|
|
418
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
419
|
-
name: "Add support for custom themes",
|
|
420
|
-
project: (0, import_live_object.makeRef)(projectDoodles),
|
|
421
|
-
assignee: (0, import_live_object.makeRef)(contactFred)
|
|
422
|
-
});
|
|
423
|
-
const _taskDoodles2 = dataSource.add(Task, {
|
|
424
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
425
|
-
name: "Implement dark mode",
|
|
426
|
-
project: (0, import_live_object.makeRef)(projectDoodles),
|
|
427
|
-
assignee: (0, import_live_object.makeRef)(contactJosiah)
|
|
428
|
-
});
|
|
429
|
-
const _orgDxos = dataSource.add(Org, {
|
|
430
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
431
|
-
name: "DXOS",
|
|
432
|
-
employees: [
|
|
433
|
-
(0, import_live_object.makeRef)(contactRich),
|
|
434
|
-
(0, import_live_object.makeRef)(contactJosiah),
|
|
435
|
-
(0, import_live_object.makeRef)(contactDima)
|
|
436
|
-
],
|
|
437
|
-
projects: [
|
|
438
|
-
(0, import_live_object.makeRef)(projectEcho)
|
|
439
|
-
]
|
|
440
|
-
});
|
|
441
|
-
const _orgBraneframe = dataSource.add(Org, {
|
|
442
|
-
id: import_echo_schema2.ObjectId.random(),
|
|
443
|
-
name: "Braneframe",
|
|
444
|
-
employees: [
|
|
445
|
-
(0, import_live_object.makeRef)(contactJosiah),
|
|
446
|
-
(0, import_live_object.makeRef)(contactRich)
|
|
447
|
-
],
|
|
448
|
-
projects: [
|
|
449
|
-
(0, import_live_object.makeRef)(projectComposer)
|
|
450
|
-
]
|
|
451
|
-
});
|
|
452
|
-
dataSource.computeGraph();
|
|
453
|
-
return dataSource;
|
|
454
|
-
};
|
|
455
|
-
var MockDataSource = class {
|
|
456
|
-
constructor() {
|
|
457
|
-
this.objects = {};
|
|
458
|
-
this.schema = {};
|
|
459
|
-
this.nodes = [];
|
|
460
|
-
this.relationships = [];
|
|
461
|
-
}
|
|
462
|
-
async getNodes({ label }) {
|
|
463
|
-
return this.nodes.filter((node) => !label || node.label === label);
|
|
464
|
-
}
|
|
465
|
-
async getRelationships({ label }) {
|
|
466
|
-
return this.relationships.filter((relationship) => !label || relationship.label === label);
|
|
467
|
-
}
|
|
468
|
-
add(schema, data) {
|
|
469
|
-
(0, import_invariant.invariant)(typeof data.id === "string", "Data must have an id", {
|
|
470
|
-
F: __dxlog_file2,
|
|
471
|
-
L: 277,
|
|
472
|
-
S: this,
|
|
473
|
-
A: [
|
|
474
|
-
"typeof data.id === 'string'",
|
|
475
|
-
"'Data must have an id'"
|
|
476
|
-
]
|
|
477
|
-
});
|
|
478
|
-
const jsonSchema = (0, import_echo_schema2.toJsonSchema)(schema);
|
|
479
|
-
if (!this.schema[jsonSchema.$id]) {
|
|
480
|
-
this.schema[jsonSchema.$id] = {
|
|
481
|
-
json: jsonSchema,
|
|
482
|
-
instance: schema
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
const typenameDxn = jsonSchema.$id ?? (0, import_debug.raise)(new Error("Schema must have $id"));
|
|
486
|
-
this.objects[data.id] = {
|
|
487
|
-
schema,
|
|
488
|
-
id: data.id,
|
|
489
|
-
typeDxn: typenameDxn,
|
|
490
|
-
data
|
|
491
|
-
};
|
|
492
|
-
return data;
|
|
493
|
-
}
|
|
494
|
-
computeGraph() {
|
|
495
|
-
this.nodes = [];
|
|
496
|
-
this.relationships = [];
|
|
497
|
-
for (const object of Object.values(this.objects)) {
|
|
498
|
-
this.nodes.push({
|
|
499
|
-
kind: "node",
|
|
500
|
-
id: object.id,
|
|
501
|
-
label: (0, import_chunk_IBOBRBDF.formatNodeLabel)(object.typeDxn),
|
|
502
|
-
properties: object.data
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
for (const object of Object.values(this.objects)) {
|
|
506
|
-
const schema = this.schema[object.typeDxn].json;
|
|
507
|
-
const typenameDxn = schema.$id ?? (0, import_debug.raise)(new Error("Schema must have $id"));
|
|
508
|
-
for (const [name, propSchema] of Object.entries(schema.properties)) {
|
|
509
|
-
if (propSchema.$id === import_echo_schema2.JSON_SCHEMA_ECHO_REF_ID) {
|
|
510
|
-
const label = (0, import_chunk_IBOBRBDF.formatInferredRelationshipLabel)(typenameDxn, name);
|
|
511
|
-
const source = this.nodes.find((node) => node.id === object.id);
|
|
512
|
-
if (!source) {
|
|
513
|
-
continue;
|
|
514
|
-
}
|
|
515
|
-
const { id: targetId } = object.data[name].target;
|
|
516
|
-
const target = this.nodes.find((node) => node.id === targetId);
|
|
517
|
-
if (!target) {
|
|
518
|
-
continue;
|
|
519
|
-
}
|
|
520
|
-
this.relationships.push({
|
|
521
|
-
kind: "relationship",
|
|
522
|
-
id: `${object.id}-${name}-${target.id}`,
|
|
523
|
-
label,
|
|
524
|
-
properties: {},
|
|
525
|
-
source,
|
|
526
|
-
target
|
|
527
|
-
});
|
|
528
|
-
} else if (propSchema.type === "array" && propSchema.items && typeof propSchema.items === "object" && "$id" in propSchema.items && propSchema.items.$id === import_echo_schema2.JSON_SCHEMA_ECHO_REF_ID) {
|
|
529
|
-
const label = (0, import_chunk_IBOBRBDF.formatInferredRelationshipLabel)(typenameDxn, name);
|
|
530
|
-
const source = this.nodes.find((node) => node.id === object.id);
|
|
531
|
-
if (!source) {
|
|
532
|
-
continue;
|
|
533
|
-
}
|
|
534
|
-
for (const { id: targetId } of object.data[name].map((x) => x.target)) {
|
|
535
|
-
const target = this.nodes.find((node) => node.id === targetId);
|
|
536
|
-
if (!target) {
|
|
537
|
-
continue;
|
|
538
|
-
}
|
|
539
|
-
this.relationships.push({
|
|
540
|
-
kind: "relationship",
|
|
541
|
-
id: `${object.id}-${name}-${targetId}`,
|
|
542
|
-
label,
|
|
543
|
-
properties: {},
|
|
544
|
-
source,
|
|
545
|
-
target
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
var ObjectId2 = import_effect2.Schema.String.annotations({
|
|
554
|
-
description: "The unique object identifier."
|
|
555
|
-
});
|
|
556
|
-
var Contact = import_effect2.Schema.Struct({
|
|
557
|
-
id: ObjectId2,
|
|
558
|
-
name: import_effect2.Schema.String.annotations({
|
|
559
|
-
description: "The name of the person."
|
|
560
|
-
}),
|
|
561
|
-
email: import_effect2.Schema.optional(import_effect2.Schema.String).annotations({
|
|
562
|
-
description: "Email address."
|
|
563
|
-
})
|
|
564
|
-
}).pipe(import_effect2.Schema.mutable).annotations({
|
|
565
|
-
[import_echo_schema3.TypeAnnotationId]: {
|
|
566
|
-
kind: import_echo_schema3.EntityKind.Object,
|
|
567
|
-
typename: "example.com/type/Contact",
|
|
568
|
-
version: "0.1.0"
|
|
569
|
-
},
|
|
570
|
-
description: "Contact information."
|
|
571
|
-
});
|
|
572
|
-
var Project = import_effect2.Schema.Struct({
|
|
573
|
-
id: ObjectId2,
|
|
574
|
-
name: import_effect2.Schema.String.annotations({
|
|
575
|
-
description: "The name of the project."
|
|
576
|
-
}),
|
|
577
|
-
description: import_effect2.Schema.optional(import_effect2.Schema.String).annotations({
|
|
578
|
-
description: "The description of the project."
|
|
579
|
-
})
|
|
580
|
-
}).pipe(import_effect2.Schema.mutable).annotations({
|
|
581
|
-
[import_echo_schema3.TypeAnnotationId]: {
|
|
582
|
-
kind: import_echo_schema3.EntityKind.Object,
|
|
583
|
-
typename: "example.com/type/Project",
|
|
584
|
-
version: "0.1.0"
|
|
585
|
-
},
|
|
586
|
-
description: "Contact information."
|
|
587
|
-
});
|
|
588
|
-
var Task = import_effect2.Schema.Struct({
|
|
589
|
-
id: ObjectId2,
|
|
590
|
-
name: import_effect2.Schema.String.annotations({
|
|
591
|
-
description: "The name of the task."
|
|
592
|
-
}),
|
|
593
|
-
description: import_effect2.Schema.optional(import_effect2.Schema.String).annotations({
|
|
594
|
-
description: "The description of the task."
|
|
595
|
-
}),
|
|
596
|
-
project: (0, import_echo_schema3.Ref)(Project),
|
|
597
|
-
assignee: (0, import_echo_schema3.Ref)(Contact)
|
|
598
|
-
}).pipe(import_effect2.Schema.mutable).annotations({
|
|
599
|
-
[import_echo_schema3.TypeAnnotationId]: {
|
|
600
|
-
kind: import_echo_schema3.EntityKind.Object,
|
|
601
|
-
typename: "example.com/type/Task",
|
|
602
|
-
version: "0.1.0"
|
|
603
|
-
},
|
|
604
|
-
description: "Contact information."
|
|
605
|
-
});
|
|
606
|
-
var Org = import_effect2.Schema.Struct({
|
|
607
|
-
id: ObjectId2,
|
|
608
|
-
name: import_effect2.Schema.String.annotations({
|
|
609
|
-
description: "The name of the organization."
|
|
610
|
-
}),
|
|
611
|
-
projects: import_effect2.Schema.Array((0, import_echo_schema3.Ref)(Project)),
|
|
612
|
-
employees: import_effect2.Schema.Array((0, import_echo_schema3.Ref)(Contact))
|
|
613
|
-
}).pipe(import_effect2.Schema.mutable).annotations({
|
|
614
|
-
[import_echo_schema3.TypeAnnotationId]: {
|
|
615
|
-
kind: import_echo_schema3.EntityKind.Object,
|
|
616
|
-
typename: "example.com/type/Org",
|
|
617
|
-
version: "0.1.0"
|
|
618
|
-
},
|
|
619
|
-
description: "Contact information."
|
|
620
|
-
});
|
|
621
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
622
|
-
0 && (module.exports = {
|
|
623
|
-
AI_SERVICE_ENDPOINT,
|
|
624
|
-
Contact,
|
|
625
|
-
MockDataSource,
|
|
626
|
-
ObjectId,
|
|
627
|
-
Org,
|
|
628
|
-
Project,
|
|
629
|
-
Task,
|
|
630
|
-
createCypherTool,
|
|
631
|
-
createLogger,
|
|
632
|
-
createSystemPrompt,
|
|
633
|
-
createTestData,
|
|
634
|
-
createTestOllamaClient,
|
|
635
|
-
seedTestData
|
|
636
|
-
});
|
|
637
|
-
//# sourceMappingURL=index.cjs.map
|