@segmentstream/agent 0.17.21 → 0.18.1
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/README.md +47 -38
- package/dist/_chunks/{build-metadata-CEQMVxxj.mjs → build-metadata-CFvllAYE.mjs} +1 -1
- package/dist/extension/_manifest.json +1 -0
- package/dist/extension/channels/telegram.mjs +1 -1
- package/dist/extension/config.d.ts +2 -4
- package/dist/extension/config.mjs +1 -2
- package/dist/extension/connections/ontology.d.ts +3 -0
- package/dist/extension/connections/ontology.mjs +19 -0
- package/dist/extension/hooks/ontology-files.d.ts +2 -0
- package/dist/extension/hooks/ontology-files.mjs +10 -0
- package/dist/extension/instructions/sandbox.mjs +6 -4
- package/dist/extension/instructions.md +17 -16
- package/dist/extension/lib/build-metadata.mjs +1 -1
- package/dist/extension/lib/deferred-confirmations.d.ts +1 -4
- package/dist/extension/lib/deferred-confirmations.mjs +3 -89
- package/dist/extension/lib/ontology-connection.d.ts +4 -3
- package/dist/extension/lib/ontology-connection.mjs +6 -19
- package/dist/extension/lib/ontology-file-call.d.ts +10 -0
- package/dist/extension/lib/ontology-file-call.mjs +171 -0
- package/dist/extension/lib/ontology-tools.d.ts +0 -4
- package/dist/extension/lib/ontology-tools.mjs +0 -7
- package/dist/extension/lib/telegram/adapter.d.ts +1 -1
- package/dist/extension/lib/telegram/adapter.mjs +2 -2
- package/dist/extension/lib/telegram/health.d.ts +1 -1
- package/dist/extension/lib/telegram/health.mjs +1 -1
- package/dist/extension/lib/telegram/lifecycle.mjs +1 -1
- package/dist/extension/schedules/confirmations.mjs +1 -1
- package/dist/extension/tools/ontology_call_file.d.ts +2 -0
- package/dist/extension/tools/ontology_call_file.mjs +11 -0
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.mjs +2 -2
- package/package.json +2 -2
- package/dist/extension/lib/ontology-arguments.d.ts +0 -28
- package/dist/extension/lib/ontology-arguments.mjs +0 -54
- package/dist/extension/lib/ontology-gateway.d.ts +0 -20
- package/dist/extension/lib/ontology-gateway.mjs +0 -52
- package/dist/extension/lib/ontology-metadata-read.d.ts +0 -15
- package/dist/extension/lib/ontology-metadata-read.mjs +0 -136
- package/dist/extension/tools/ontology.d.ts +0 -28
- package/dist/extension/tools/ontology.mjs +0 -137
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type OntologyCallInput } from "../lib/ontology-arguments.js";
|
|
2
|
-
declare const _default: import("eve").DynamicSentinel<{
|
|
3
|
-
ontology_discover: import("eve/tools").ToolDefinition<Record<string, unknown>, Record<string, unknown>> & {
|
|
4
|
-
execute(input: Record<string, unknown>, ctx: import("eve/tools").ToolContext): Promise<Record<string, unknown>>;
|
|
5
|
-
};
|
|
6
|
-
ontology_describe: import("eve/tools").ToolDefinition<Record<string, unknown>, Record<string, unknown>> & {
|
|
7
|
-
execute(input: Record<string, unknown>, ctx: import("eve/tools").ToolContext): Promise<Record<string, unknown>>;
|
|
8
|
-
};
|
|
9
|
-
ontology_inspect: import("eve/tools").ToolDefinition<Record<string, unknown>, {
|
|
10
|
-
next_after?: string | undefined;
|
|
11
|
-
tools: (Record<string, unknown> & {
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
})[];
|
|
15
|
-
}> & {
|
|
16
|
-
execute(input: Record<string, unknown>, ctx: import("eve/tools").ToolContext): Promise<{
|
|
17
|
-
next_after?: string | undefined;
|
|
18
|
-
tools: (Record<string, unknown> & {
|
|
19
|
-
name: string;
|
|
20
|
-
description: string;
|
|
21
|
-
})[];
|
|
22
|
-
}>;
|
|
23
|
-
};
|
|
24
|
-
ontology_call: import("eve/tools").ToolDefinition<{
|
|
25
|
-
name: string;
|
|
26
|
-
} & OntologyCallInput, Record<string, unknown>>;
|
|
27
|
-
} | null>;
|
|
28
|
-
export default _default;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
-
import { dirname as __eveDirname } from "node:path";
|
|
3
|
-
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
-
__eveDirname(__filename);
|
|
6
|
-
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { i as memberIdOf } from "../../_chunks/principal-Dmm-cXNF.mjs";
|
|
8
|
-
import segmentstream from "../extension.mjs";
|
|
9
|
-
import { executeDeferredTool } from "../lib/deferred-confirmations.mjs";
|
|
10
|
-
import { MAXIMUM_ARGUMENTS_FILE_BYTES, ontologyCallArguments } from "../lib/ontology-arguments.mjs";
|
|
11
|
-
import { ontologyInspect, ontologyMetadata } from "../lib/ontology-gateway.mjs";
|
|
12
|
-
import { defineDynamic, defineTool } from "eve/tools";
|
|
13
|
-
var ontology_default = defineDynamic({ events: { "turn.started": async (_event, context) => {
|
|
14
|
-
const memberId = memberIdOf(context.session.auth.current);
|
|
15
|
-
if (!segmentstream.config.ontology.connection || segmentstream.config.confirmations.mode !== "deferred" || memberId === void 0) return null;
|
|
16
|
-
const sandbox = segmentstream.config.sandbox === true;
|
|
17
|
-
return {
|
|
18
|
-
ontology_discover: defineTool({
|
|
19
|
-
description: "Search the permitted ontology's entities, actions and measures by words. Inspect returned refs with ontology_describe before calling ontology_call.",
|
|
20
|
-
inputSchema: {
|
|
21
|
-
type: "object",
|
|
22
|
-
properties: {
|
|
23
|
-
query: {
|
|
24
|
-
type: "string",
|
|
25
|
-
minLength: 1,
|
|
26
|
-
maxLength: 512
|
|
27
|
-
},
|
|
28
|
-
kind: {
|
|
29
|
-
type: "string",
|
|
30
|
-
enum: [
|
|
31
|
-
"entity",
|
|
32
|
-
"action",
|
|
33
|
-
"measure"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
entity: { type: "string" },
|
|
37
|
-
mode: {
|
|
38
|
-
type: "string",
|
|
39
|
-
enum: [
|
|
40
|
-
"auto",
|
|
41
|
-
"literal",
|
|
42
|
-
"fuzzy"
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
after: { type: "string" },
|
|
46
|
-
expected_hash: {
|
|
47
|
-
type: "string",
|
|
48
|
-
pattern: "^sha256:[a-f0-9]{64}$"
|
|
49
|
-
},
|
|
50
|
-
limit: {
|
|
51
|
-
type: "integer",
|
|
52
|
-
minimum: 1,
|
|
53
|
-
maximum: 50
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
required: ["query"],
|
|
57
|
-
additionalProperties: false
|
|
58
|
-
},
|
|
59
|
-
execute: (input, ctx) => ontologyMetadata(memberId, "discover", input, ctx)
|
|
60
|
-
}),
|
|
61
|
-
ontology_describe: defineTool({
|
|
62
|
-
description: "Inspect an ontology entity:, action: or measure: ref, including its exact operation names and schemas. Omit ref for the entity index. Follow next_cursor with after.",
|
|
63
|
-
inputSchema: {
|
|
64
|
-
type: "object",
|
|
65
|
-
properties: {
|
|
66
|
-
ref: {
|
|
67
|
-
type: "string",
|
|
68
|
-
minLength: 1,
|
|
69
|
-
maxLength: 256
|
|
70
|
-
},
|
|
71
|
-
after: { type: "string" },
|
|
72
|
-
expected_hash: {
|
|
73
|
-
type: "string",
|
|
74
|
-
pattern: "^sha256:[a-f0-9]{64}$"
|
|
75
|
-
},
|
|
76
|
-
limit: {
|
|
77
|
-
type: "integer",
|
|
78
|
-
minimum: 1,
|
|
79
|
-
maximum: 100
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
additionalProperties: false
|
|
83
|
-
},
|
|
84
|
-
execute: (input, ctx) => ontologyMetadata(memberId, "describe", input, ctx)
|
|
85
|
-
}),
|
|
86
|
-
ontology_inspect: defineTool({
|
|
87
|
-
description: "Find permission-filtered MCP operation names and complete input schemas, including entity find/get/history reads. Supply name for an exact definition, query for words, or omit both for a paged tool index. Use next_after as after. This reads metadata only.",
|
|
88
|
-
inputSchema: {
|
|
89
|
-
type: "object",
|
|
90
|
-
properties: {
|
|
91
|
-
name: {
|
|
92
|
-
type: "string",
|
|
93
|
-
minLength: 1
|
|
94
|
-
},
|
|
95
|
-
query: {
|
|
96
|
-
type: "string",
|
|
97
|
-
minLength: 1,
|
|
98
|
-
maxLength: 512
|
|
99
|
-
},
|
|
100
|
-
after: { type: "string" },
|
|
101
|
-
limit: {
|
|
102
|
-
type: "integer",
|
|
103
|
-
minimum: 1,
|
|
104
|
-
maximum: 50
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
additionalProperties: false
|
|
108
|
-
},
|
|
109
|
-
execute: (input, ctx) => ontologyInspect(memberId, input, ctx)
|
|
110
|
-
}),
|
|
111
|
-
ontology_call: defineTool({
|
|
112
|
-
description: "Run a permitted ontology operation by the exact MCP tool name from its inspected definition, with arguments matching that schema. Reads and routine actions run immediately; consequential actions retain native deferred confirmation. An awaiting_confirmation result means the action has not run." + (sandbox ? " Instead of arguments, give arguments_file: the path of a JSON object file inside /workspace that a script wrote, so large or exact values reach the operation unchanged instead of being retyped." : ""),
|
|
113
|
-
inputSchema: {
|
|
114
|
-
type: "object",
|
|
115
|
-
properties: {
|
|
116
|
-
name: {
|
|
117
|
-
type: "string",
|
|
118
|
-
minLength: 1
|
|
119
|
-
},
|
|
120
|
-
arguments: {
|
|
121
|
-
type: "object",
|
|
122
|
-
additionalProperties: true
|
|
123
|
-
},
|
|
124
|
-
...sandbox ? { arguments_file: {
|
|
125
|
-
type: "string",
|
|
126
|
-
minLength: 1,
|
|
127
|
-
description: `Instead of arguments: the absolute path of a UTF-8 JSON file inside /workspace in the sandbox, at most ${MAXIMUM_ARGUMENTS_FILE_BYTES / 1024 / 1024} MiB, holding one object used as the arguments. Give arguments or arguments_file, not both.`
|
|
128
|
-
} } : {}
|
|
129
|
-
},
|
|
130
|
-
required: ["name"],
|
|
131
|
-
additionalProperties: false
|
|
132
|
-
},
|
|
133
|
-
execute: async (input, ctx) => executeDeferredTool(memberId, input.name, await ontologyCallArguments(input, ctx, { sandbox }), ctx, { texts: () => segmentstream.config.texts ?? {} })
|
|
134
|
-
})
|
|
135
|
-
};
|
|
136
|
-
} } });
|
|
137
|
-
export { ontology_default as default };
|