@segmentstream/agent 0.17.20 → 0.18.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.
Files changed (40) hide show
  1. package/README.md +47 -38
  2. package/dist/_chunks/{build-metadata-SPt2pkRF.mjs → build-metadata-PY8Xja6K.mjs} +1 -1
  3. package/dist/extension/_manifest.json +1 -0
  4. package/dist/extension/channels/telegram.mjs +1 -1
  5. package/dist/extension/config.d.ts +2 -4
  6. package/dist/extension/config.mjs +1 -2
  7. package/dist/extension/connections/ontology.d.ts +3 -0
  8. package/dist/extension/connections/ontology.mjs +19 -0
  9. package/dist/extension/hooks/ontology-files.d.ts +2 -0
  10. package/dist/extension/hooks/ontology-files.mjs +10 -0
  11. package/dist/extension/instructions/sandbox.mjs +6 -4
  12. package/dist/extension/instructions.md +16 -16
  13. package/dist/extension/lib/build-metadata.mjs +1 -1
  14. package/dist/extension/lib/deferred-confirmations.d.ts +1 -4
  15. package/dist/extension/lib/deferred-confirmations.mjs +3 -89
  16. package/dist/extension/lib/ontology-connection.d.ts +4 -3
  17. package/dist/extension/lib/ontology-connection.mjs +6 -19
  18. package/dist/extension/lib/ontology-file-call.d.ts +10 -0
  19. package/dist/extension/lib/ontology-file-call.mjs +171 -0
  20. package/dist/extension/lib/ontology-tools.d.ts +0 -4
  21. package/dist/extension/lib/ontology-tools.mjs +0 -7
  22. package/dist/extension/lib/telegram/adapter.d.ts +1 -1
  23. package/dist/extension/lib/telegram/adapter.mjs +2 -2
  24. package/dist/extension/lib/telegram/health.d.ts +1 -1
  25. package/dist/extension/lib/telegram/health.mjs +1 -1
  26. package/dist/extension/lib/telegram/lifecycle.mjs +1 -1
  27. package/dist/extension/schedules/confirmations.mjs +1 -1
  28. package/dist/extension/tools/ontology_call_file.d.ts +2 -0
  29. package/dist/extension/tools/ontology_call_file.mjs +11 -0
  30. package/dist/tools/index.d.ts +1 -1
  31. package/dist/tools/index.mjs +2 -2
  32. package/package.json +2 -2
  33. package/dist/extension/lib/ontology-arguments.d.ts +0 -28
  34. package/dist/extension/lib/ontology-arguments.mjs +0 -54
  35. package/dist/extension/lib/ontology-gateway.d.ts +0 -20
  36. package/dist/extension/lib/ontology-gateway.mjs +0 -52
  37. package/dist/extension/lib/ontology-metadata-read.d.ts +0 -15
  38. package/dist/extension/lib/ontology-metadata-read.mjs +0 -136
  39. package/dist/extension/tools/ontology.d.ts +0 -28
  40. 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 };