@segmentstream/ontology 0.96.0 → 0.98.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 (50) hide show
  1. package/README.md +15 -3
  2. package/dist/agent-review.d.ts +95 -0
  3. package/dist/agent-review.js +200 -0
  4. package/dist/analyze.d.ts +10 -2
  5. package/dist/analyze.js +240 -19
  6. package/dist/bin/check.js +2 -0
  7. package/dist/chat.d.ts +16 -0
  8. package/dist/diagnostics.d.ts +3 -3
  9. package/dist/diagnostics.js +2 -0
  10. package/dist/index.d.ts +5 -1
  11. package/dist/index.js +2 -0
  12. package/dist/manifest.d.ts +505 -2
  13. package/dist/manifest.js +55 -2
  14. package/dist/migrate/model.d.ts +272 -0
  15. package/dist/ontology.d.ts +3 -0
  16. package/dist/ontology.js +1 -0
  17. package/dist/permissions.d.ts +5 -3
  18. package/dist/permissions.js +9 -5
  19. package/dist/runtime/agents.js +53 -0
  20. package/dist/service/agent/protocol.d.ts +18 -0
  21. package/dist/service/agent/protocol.js +33 -0
  22. package/dist/service/agent/server.js +48 -1
  23. package/dist/service/catalog.js +10 -1
  24. package/dist/service/chat/archive.d.ts +2 -1
  25. package/dist/service/chat/delivery.js +11 -0
  26. package/dist/service/chat/envelope.d.ts +16 -16
  27. package/dist/service/chat/providers/provider.d.ts +2 -0
  28. package/dist/service/chat/providers/slack.js +1 -1
  29. package/dist/service/chat/providers/telegram.d.ts +6 -1
  30. package/dist/service/chat/providers/telegram.js +14 -3
  31. package/dist/service/chat/providers/whatsapp.js +1 -1
  32. package/dist/service/chat/review-delivery.d.ts +38 -0
  33. package/dist/service/chat/review-delivery.js +258 -0
  34. package/dist/service/connections.js +1 -0
  35. package/dist/service/discovery-search.d.ts +1 -1
  36. package/dist/service/mcp/runtime-policy.js +5 -1
  37. package/dist/service/mcp/server.js +13 -1
  38. package/dist/service/mcp/tools.d.ts +5 -0
  39. package/dist/service/mcp/tools.js +30 -0
  40. package/dist/service/operations.d.ts +3 -1
  41. package/dist/service/operations.js +16 -1
  42. package/dist/service/runtime-contract.d.ts +28 -0
  43. package/dist/service/schemas.d.ts +62 -0
  44. package/dist/service/toolsets.d.ts +49 -0
  45. package/dist/service/toolsets.js +284 -0
  46. package/dist/slack.js +3 -1
  47. package/dist/toolset.d.ts +141 -0
  48. package/dist/toolset.js +154 -0
  49. package/dist/whatsapp.js +3 -1
  50. package/package.json +1 -1
package/dist/analyze.js CHANGED
@@ -6,7 +6,7 @@ import { isBlobAccept, MAX_BLOB_BYTES } from "./blob.js";
6
6
  import { isAction } from "./action.js";
7
7
  import { CONNECTION_KEY, isConnection } from "./connection.js";
8
8
  import { isEntity } from "./entity.js";
9
- import { QUERY_METRICS_ROUTE, LEGACY_MEMBER_NAME, ENTITY_ID, GENERATED_ACTIONS, GENERATED_UPSERT_PREFIX, HISTORY_SUFFIX, MCP_METRIC_TOOLS, MCP_READ_TOOLS, MCP_TOOL_NAME_MAX_LENGTH, MEMBER_ROLE, FEEDBACK_REPORTER_ROLE, mcpToolName, RESERVED_ENTITY_NAMES, RESERVED_MEMBER_NAMES, RESERVED_RELATIONSHIP_NAMES, SNAKE_CASE_NAME, SYSTEM_PROPERTIES, isSystemProperty, toCamelCase, } from "./names.js";
9
+ import { QUERY_METRICS_ROUTE, LEGACY_MEMBER_NAME, ENTITY_ID, GENERATED_ACTIONS, GENERATED_UPSERT_PREFIX, HISTORY_SUFFIX, MCP_METRIC_TOOLS, MCP_READ_TOOLS, MCP_TOOL_NAME_MAX_LENGTH, MEMBER_ROLE, FEEDBACK_REPORTER_ROLE, mcpToolName, RESERVED_ENTITY_NAMES, RESERVED_MEMBER_NAMES, RESERVED_RELATIONSHIP_NAMES, SNAKE_CASE_NAME, SYSTEM_PROPERTIES, humanize, isSystemProperty, toCamelCase, } from "./names.js";
10
10
  import { REFERENCE_ANNOTATION, propertyDefinition, propertyOptionNames, unknownPropertyOptions, referenceTarget, } from "./property.js";
11
11
  import { generatedActionPermissions, grants, isAllowed, normalizePermission, parsePermission, parseWorkflowPermission, permissionOf, READ_VERB, rolesGranting, USER_IDENTITY_VERBS, USER_MEMBER_VERBS, WILDCARD, wildcardEntityCovers, } from "./permissions.js";
12
12
  import { ON_DELETE, isRelationship } from "./relationship.js";
@@ -14,6 +14,7 @@ import { isRole, member, role } from "./role.js";
14
14
  import { CHANNEL_PROVIDERS, DEFAULT_SIGN_IN_POLICY, SIGN_UP_CHANNELS, SIGN_UP_CHAT_CHANNELS, isSignInPolicy, isSignUpChannel, } from "./sign-in.js";
15
15
  import { emailOptions } from "./emails.js";
16
16
  import { AgentChat } from "./agent-chat.js";
17
+ import { AgentReview } from "./agent-review.js";
17
18
  import { APP_FEEDBACK_ENTITIES } from "./app-feedback.js";
18
19
  import { feedbackOptions, feedbackRoles, checkFeedbackResponders, } from "./feedback-config.js";
19
20
  import { User } from "./user.js";
@@ -29,6 +30,7 @@ import { cronNeverFires, cronProblem, isAsyncFunction, isWorkflow, isWorkflowTri
29
30
  import { MAX_WEBHOOK_HEADERS, MAX_WEBHOOKS, WEBHOOK_SIGNATURE_SCHEMES, webhookDelivery, webhookHeaderProblem, WORKSPACE_SECRET_NAME, } from "./webhooks.js";
30
31
  import { actionInputToWire } from "./authoring-input.js";
31
32
  import { validate } from "./runtime/validation.js";
33
+ import { fixedArgumentsConflict, isToolset, MAXIMUM_TOOLSET_TOOLS, MCP_TOOL_NAME, toolHints, ToolsetLock, withoutFixedArguments, } from "./toolset.js";
32
34
  const GENERATED_UPSERT = new RegExp(`^${GENERATED_UPSERT_PREFIX}`);
33
35
  /** The providers `chat` may declare a posting connection for, in the order posting lists them. */
34
36
  const CHAT_PROVIDER_KEYS = ["telegram", "slack", "whatsapp"];
@@ -56,6 +58,7 @@ export function analyze(config, options = {}) {
56
58
  options.user ?? User,
57
59
  AgentChat,
58
60
  UserIdentity,
61
+ AgentReview,
59
62
  ...(feedbackSetting !== false ? APP_FEEDBACK_ENTITIES : []),
60
63
  ], report);
61
64
  config = normalized.config;
@@ -122,13 +125,18 @@ export function analyze(config, options = {}) {
122
125
  };
123
126
  }
124
127
  const { feedback, roles } = feedbackRoles(feedbackSetting, files, declaredRoles, report);
125
- // Resolve authored entities before the optional feedback entities, preserving their ordering.
128
+ // Resolve authored entities before the optional feedback entities and the agent's reviews,
129
+ // preserving their ordering: built-ins added later never move an authored entity.
126
130
  const isFeedback = (candidate) => APP_FEEDBACK_ENTITIES.some((feedback) => feedback.name === candidate.name);
131
+ const isReview = (candidate) => candidate.name === AgentReview.name;
127
132
  let resolved = [
128
133
  ...entities
129
- .filter((candidate) => !isFeedback(candidate))
134
+ .filter((candidate) => !isFeedback(candidate) && !isReview(candidate))
130
135
  .map((candidate) => resolveEntity(candidate, scope, properties.get(candidate))),
131
136
  ...entities.filter(isFeedback).map((candidate) => resolveEntity(candidate, scope)),
137
+ ...entities
138
+ .filter(isReview)
139
+ .map((candidate) => resolveEntity(candidate, scope, properties.get(candidate))),
132
140
  ];
133
141
  let chat;
134
142
  if (config.chat !== undefined) {
@@ -167,11 +175,16 @@ export function analyze(config, options = {}) {
167
175
  ...Object.fromEntries(handles.map(([name, handle]) => [name, { connection: handle.key }])),
168
176
  ...(config.chat.attribution === undefined ? {} : { attribution: config.chat.attribution }),
169
177
  };
170
- resolved = resolved.map((entity) => entity.name !== "agent_chat"
178
+ // Posting to a chat and sending a reviewed reply both send through the chat connections.
179
+ const sends = {
180
+ agent_chat: "post_message",
181
+ agent_review: "approve",
182
+ };
183
+ resolved = resolved.map((entity) => sends[entity.name] === undefined
171
184
  ? entity
172
185
  : {
173
186
  ...entity,
174
- actions: entity.actions.map((candidate) => candidate.name !== "post_message"
187
+ actions: entity.actions.map((candidate) => candidate.name !== sends[entity.name]
175
188
  ? candidate
176
189
  : {
177
190
  ...candidate,
@@ -199,7 +212,8 @@ export function analyze(config, options = {}) {
199
212
  }
200
213
  checkEntityIdentities(resolved, report);
201
214
  checkMemberNames(resolved, report);
202
- checkToolNames(resolved, report);
215
+ const toolsets = resolveToolsets(original.toolsets, resolved, connections, report);
216
+ checkToolNames(resolved, report, toolsets);
203
217
  checkWarehouseSource(resolved, report);
204
218
  const metrics = resolveModelMetrics({ metrics: config.metrics, entities: resolved, report });
205
219
  const workflows = resolveWorkflows({
@@ -209,14 +223,11 @@ export function analyze(config, options = {}) {
209
223
  scope,
210
224
  checkGrants: options.checkPermissions !== false,
211
225
  });
212
- checkConnectionsUsed(resolved, connections, config.connections ?? [], workflows, report);
226
+ checkConnectionsUsed(resolved, connections, config.connections ?? [], workflows, report, toolsets);
213
227
  if (options.checkPermissions !== false) {
214
228
  // Validate authored grants before augmentation can replace a scoped grant with an unscoped
215
229
  // builder grant. Invalid authored scopes must remain errors; generated redundancy needs no warning.
216
- checkPermissions(resolved, roles, workflows, report, [
217
- ...declaredRoles,
218
- ...roles.filter((candidate) => candidate.name === FEEDBACK_REPORTER_ROLE),
219
- ]);
230
+ checkPermissions(resolved, roles, workflows, report, [...declaredRoles, ...roles.filter((candidate) => candidate.name === FEEDBACK_REPORTER_ROLE)], toolsets);
220
231
  checkOpenWarehouseReads({ entities: resolved, roles, signIn, report });
221
232
  checkOpenChannels({ config, entities: resolved, roles, signIn, report });
222
233
  checkNewUserAction({ entities: resolved, roles, signIn, report });
@@ -253,6 +264,7 @@ export function analyze(config, options = {}) {
253
264
  connections,
254
265
  metrics,
255
266
  workflows,
267
+ toolsets,
256
268
  diagnostics,
257
269
  ...(chat === undefined ? {} : { chat }),
258
270
  };
@@ -814,7 +826,7 @@ function toolOperations(candidate) {
814
826
  * entity's and the operation's with an underscore, so entity `pilot` with an action `request_find`
815
827
  * would take the name of entity `pilot_request`'s `find`.
816
828
  */
817
- function checkToolNames(entities, report) {
829
+ function checkToolNames(entities, report, toolsets = []) {
818
830
  const owners = new Map(MCP_METRIC_TOOLS.map((name) => [name, "the ontology's metric tools"]));
819
831
  const seen = new Set();
820
832
  for (const candidate of entities) {
@@ -837,6 +849,205 @@ function checkToolNames(entities, report) {
837
849
  }
838
850
  }
839
851
  }
852
+ for (const candidate of toolsets) {
853
+ for (const tool of candidate.tools) {
854
+ const path = `toolsets.${candidate.name}.tools.${tool.name}`;
855
+ const owner = owners.get(tool.mcpName);
856
+ if (owner !== undefined) {
857
+ report("invalid-tool-name", path, `its MCP tool ${tool.mcpName} is already the tool of ${owner}; rename the toolset.`);
858
+ continue;
859
+ }
860
+ owners.set(tool.mcpName, `toolset ${candidate.name}`);
861
+ if (tool.mcpName.length > MCP_TOOL_NAME_MAX_LENGTH) {
862
+ report("invalid-tool-name", path, `its MCP tool ${tool.mcpName} is ${tool.mcpName.length} characters long; agents accept ` +
863
+ `at most ${MCP_TOOL_NAME_MAX_LENGTH}. Shorten the toolset name.`);
864
+ }
865
+ }
866
+ }
867
+ }
868
+ const TOOLSET_KEYS = ["connection", "api", "lock", "description", "tools"];
869
+ /** Names whose tools the service already has: its routes, `chat_*`, `attachments_*` and `files_*`. */
870
+ const RESERVED_TOOLSET_NAMES = [
871
+ ...RESERVED_ENTITY_NAMES,
872
+ "attachments",
873
+ "files",
874
+ ];
875
+ const FIXED_ARGUMENT = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/;
876
+ /** Arguments the MCP server takes for itself: confirmation presentation and the runtime envelope. */
877
+ const RESERVED_TOOL_ARGUMENTS = ["_confirmation", "_segmentstream"];
878
+ const MAXIMUM_FIXED_ARGUMENTS = 16;
879
+ const MAXIMUM_FIXED_TEXT = 1024;
880
+ const LOCK_AGAIN = "write it again with segmentstream connection mcp lock";
881
+ /**
882
+ * The toolsets `defineOntology({ toolsets })` lists: each named apart from the entities, over a
883
+ * connection listed in `connections`, with a lock written for that connection's API. A toolset with
884
+ * any problem is reported and left out.
885
+ */
886
+ function resolveToolsets(declared, entities, connections, report) {
887
+ if (declared === undefined) {
888
+ return [];
889
+ }
890
+ if (!Array.isArray(declared)) {
891
+ report("invalid-toolset", "toolsets", "toolsets is a list of toolset(name, { … }) declarations.");
892
+ return [];
893
+ }
894
+ const entityNames = new Set(entities.map((candidate) => candidate.name));
895
+ const keys = new Set(connections.map((candidate) => candidate.key));
896
+ const seen = new Set();
897
+ const resolved = [];
898
+ declared.forEach((candidate, index) => {
899
+ if (!isToolset(candidate)) {
900
+ report("invalid-toolset", `toolsets[${index}]`, "is not a toolset; declare it with toolset(name, { … }).");
901
+ return;
902
+ }
903
+ if (typeof candidate.name !== "string" || !/^[a-z][a-zA-Z0-9]*$/.test(candidate.name)) {
904
+ report("invalid-name", `toolsets[${index}]`, `${JSON.stringify(candidate.name)} is not a toolset name; use a camelCase identifier ` +
905
+ "such as github.");
906
+ return;
907
+ }
908
+ const name = nameToWire(candidate.name);
909
+ const path = `toolsets.${name}`;
910
+ if (seen.has(name)) {
911
+ report("duplicate-name", path, `the toolset ${name} is declared twice.`);
912
+ return;
913
+ }
914
+ seen.add(name);
915
+ if (entityNames.has(name)) {
916
+ report("duplicate-name", path, `${name} is an entity; a toolset needs a name of its own.`);
917
+ return;
918
+ }
919
+ if (RESERVED_TOOLSET_NAMES.includes(name)) {
920
+ report("reserved-name", path, `${name} is reserved: the service's own tools or routes start with it; rename the toolset.`);
921
+ return;
922
+ }
923
+ const definition = candidate.definition;
924
+ if (!isPlainObject(definition)) {
925
+ report("invalid-toolset", path, "a toolset takes { connection, api, lock, description }.");
926
+ return;
927
+ }
928
+ let valid = true;
929
+ const fail = (code, at, message) => {
930
+ report(code, at, message);
931
+ valid = false;
932
+ };
933
+ for (const key of Object.keys(definition)) {
934
+ if (!TOOLSET_KEYS.includes(key)) {
935
+ fail("invalid-toolset", `${path}.${key}`, `a toolset takes only ${TOOLSET_KEYS.join(", ")}.`);
936
+ }
937
+ }
938
+ const { connection, api, lock, description, tools } = definition;
939
+ if (typeof description !== "string" || description.trim() === "") {
940
+ fail("missing-description", `${path}.description`, "describe what the toolset is for, in the workspace's words; agents read it to choose a tool.");
941
+ }
942
+ if (!isConnection(connection)) {
943
+ fail("invalid-connection", `${path}.connection`, "is not a connection; declare it with connection(key, { … }).");
944
+ }
945
+ else if (!keys.has(connection.key)) {
946
+ fail("unknown-connection", `${path}.connection`, `the connection ${String(connection.key)} is not listed in defineOntology({ connections }).`);
947
+ }
948
+ if (typeof api !== "string" || !/^[a-z][a-z0-9_]{0,63}$/.test(api)) {
949
+ fail("invalid-toolset", `${path}.api`, "api names the connection's MCP API in connections/connections.py, such as mcp.");
950
+ }
951
+ const decoded = Schema.decodeUnknownResult(ToolsetLock)(lock);
952
+ if (Result.isFailure(decoded)) {
953
+ fail("invalid-toolset", `${path}.lock`, `is not a toolset lock of this SDK; ${LOCK_AGAIN}.`);
954
+ return;
955
+ }
956
+ const locked = decoded.success;
957
+ if (isConnection(connection) && (locked.connection !== connection.key || locked.api !== api)) {
958
+ fail("toolset-lock-mismatch", `${path}.lock`, `the lock is for ${locked.connection}'s ${locked.api} API, not ` +
959
+ `${String(connection.key)}'s ${String(api)}; ${LOCK_AGAIN} ${String(connection.key)}.`);
960
+ }
961
+ if (locked.tools.length === 0 || locked.tools.length > MAXIMUM_TOOLSET_TOOLS) {
962
+ fail("invalid-toolset", `${path}.lock`, `a toolset serves 1 to ${MAXIMUM_TOOLSET_TOOLS} tools; declare them on the connection's ` +
963
+ `MCP API and ${LOCK_AGAIN}.`);
964
+ }
965
+ const names = new Set();
966
+ for (const tool of locked.tools) {
967
+ const at = `${path}.tools.${tool.name}`;
968
+ if (!MCP_TOOL_NAME.test(tool.name)) {
969
+ fail("invalid-toolset", at, `${JSON.stringify(tool.name)} is not a tool name: lowercase snake_case of at most 64 ` +
970
+ "characters.");
971
+ }
972
+ else if (tool.name === READ_VERB) {
973
+ // `<toolset>:read` is what `*:read` and the OAuth read scope grant.
974
+ fail("invalid-toolset", at, "a tool named read would be granted by *:read and by the OAuth ontology:read scope " +
975
+ "whatever it does; a toolset cannot serve it.");
976
+ }
977
+ else if (names.has(tool.name)) {
978
+ fail("duplicate-name", at, `the lock lists ${tool.name} twice; ${LOCK_AGAIN}.`);
979
+ }
980
+ names.add(tool.name);
981
+ const fixed = Object.entries(tool.fixed);
982
+ if (fixed.length > MAXIMUM_FIXED_ARGUMENTS ||
983
+ fixed.some(([argument, value]) => !FIXED_ARGUMENT.test(argument) ||
984
+ (typeof value === "string" && value.length > MAXIMUM_FIXED_TEXT) ||
985
+ (typeof value === "number" && !Number.isSafeInteger(value)))) {
986
+ fail("invalid-toolset", `${at}.fixed`, `fixed values are at most ${MAXIMUM_FIXED_ARGUMENTS} named strings, booleans and integers ` +
987
+ `of at most 2**53 - 1; ${LOCK_AGAIN}.`);
988
+ }
989
+ if (tool.inputSchema.type !== undefined && tool.inputSchema.type !== "object") {
990
+ fail("invalid-toolset", `${at}.inputSchema`, "a tool's input schema must describe an object.");
991
+ }
992
+ const properties = isPlainObject(tool.inputSchema.properties)
993
+ ? Object.keys(tool.inputSchema.properties)
994
+ : [];
995
+ const reserved = [...properties, ...Object.keys(tool.fixed)].find((argument) => RESERVED_TOOL_ARGUMENTS.includes(argument));
996
+ const conflict = fixedArgumentsConflict(tool.inputSchema, tool.fixed, tool.access);
997
+ if (conflict !== undefined) {
998
+ fail("invalid-toolset", `${at}.inputSchema`, `the tool's input uses ${conflict}, which the service cannot adjust for fixed values or ` +
999
+ "for the confirmation argument a write tool takes; serve it as a read without fixed " +
1000
+ "values or leave it out.");
1001
+ }
1002
+ if (reserved !== undefined) {
1003
+ // The service consumes these arguments itself before a call reaches the provider.
1004
+ fail("invalid-toolset", `${at}.inputSchema`, `the tool takes ${reserved}, an argument the ontology's MCP server reserves; a toolset ` +
1005
+ "cannot serve it.");
1006
+ }
1007
+ }
1008
+ if (tools !== undefined) {
1009
+ if (!isPlainObject(tools)) {
1010
+ fail("invalid-toolset", `${path}.tools`, "tools maps tool names to { description }.");
1011
+ }
1012
+ else {
1013
+ for (const [tool, options] of Object.entries(tools)) {
1014
+ const at = `${path}.tools.${tool}`;
1015
+ if (!names.has(tool)) {
1016
+ fail("invalid-toolset", at, `the lock has no tool ${tool}.`);
1017
+ }
1018
+ else if (!isPlainObject(options) ||
1019
+ Object.keys(options).some((key) => key !== "description") ||
1020
+ (options.description !== undefined &&
1021
+ (typeof options.description !== "string" || options.description.trim() === ""))) {
1022
+ fail("invalid-toolset", at, "a tool's options are { description }, a non-empty text.");
1023
+ }
1024
+ }
1025
+ }
1026
+ }
1027
+ if (!valid || !isConnection(connection) || typeof api !== "string") {
1028
+ return;
1029
+ }
1030
+ const overrides = (tools ?? {});
1031
+ resolved.push({
1032
+ name,
1033
+ description: description,
1034
+ connection: connection.key,
1035
+ api,
1036
+ protocolVersion: locked.protocolVersion,
1037
+ tools: locked.tools.map((tool) => ({
1038
+ name: tool.name,
1039
+ mcpName: mcpToolName(name, tool.name),
1040
+ permission: `${name}:${tool.name}`,
1041
+ access: tool.access,
1042
+ fixed: tool.fixed,
1043
+ description: overrides[tool.name]?.description ??
1044
+ (tool.description.trim() === "" ? humanize(tool.name) : tool.description),
1045
+ inputSchema: withoutFixedArguments(tool.inputSchema, tool.fixed),
1046
+ hints: toolHints(tool.access, tool.annotations),
1047
+ })),
1048
+ });
1049
+ });
1050
+ return resolved;
840
1051
  }
841
1052
  /** The handles `defineOntology({ connections })` lists, each with a valid key and a description. */
842
1053
  function collectConnections(config, report) {
@@ -879,15 +1090,16 @@ function collectConnections(config, report) {
879
1090
  return connections;
880
1091
  }
881
1092
  /** A listed connection that no action calls is a leftover: it grants the deployment for nothing. */
882
- function checkConnectionsUsed(entities, connections, declared, workflows, report) {
1093
+ function checkConnectionsUsed(entities, connections, declared, workflows, report, toolsets = []) {
883
1094
  const used = new Set([
884
1095
  ...entities.flatMap((entity) => entity.actions.flatMap((candidate) => candidate.connections)),
885
1096
  ...workflows.flatMap((candidate) => candidate.connections),
1097
+ ...toolsets.map((candidate) => candidate.connection),
886
1098
  ]);
887
1099
  connections.forEach((candidate) => {
888
1100
  if (!used.has(candidate.key)) {
889
- report("unused-connection", `connections[${declared.indexOf(candidate.handle)}]`, `no action or workflow calls the connection ${candidate.key}; list it in an action's ` +
890
- "or a workflow's connections or remove it.");
1101
+ report("unused-connection", `connections[${declared.indexOf(candidate.handle)}]`, `no action, workflow or toolset calls the connection ${candidate.key}; list it in an ` +
1102
+ "action's or a workflow's connections, serve it as a toolset, or remove it.");
891
1103
  }
892
1104
  });
893
1105
  }
@@ -2029,8 +2241,12 @@ function ownMembers(candidate, entitiesByName) {
2029
2241
  * built-in user also has its member management verbs, and the built-in sign-in identities their
2030
2242
  * attach and revoke, which roles may grant.
2031
2243
  */
2032
- function knownVerbs(entities) {
2244
+ function knownVerbs(entities, toolsets = []) {
2033
2245
  const verbs = new Map();
2246
+ // A toolset's tools are its verbs. Entity names are checked against toolset names elsewhere.
2247
+ for (const candidate of toolsets) {
2248
+ verbs.set(candidate.name, new Set(candidate.tools.map((tool) => tool.name)));
2249
+ }
2034
2250
  for (const candidate of entities) {
2035
2251
  const own = verbs.get(candidate.name) ?? new Set();
2036
2252
  for (const permission of Object.values(candidate.permissions)) {
@@ -2112,7 +2328,7 @@ function checkRolePermissions(candidate, verbs, workflows, report) {
2112
2328
  }
2113
2329
  if (parsed.entity === WILDCARD && parsed.verb === WILDCARD) {
2114
2330
  report("wildcard-permission", at, "*:* grants every entity and action, including those added later, except agent_chat, " +
2115
- "app_feedback, app_feedback_file, user_identity and " +
2331
+ "agent_review, app_feedback, app_feedback_file, user_identity and " +
2116
2332
  `administering users (${USER_MEMBER_VERBS.map((verb) => `user:${verb}`).join(", ")} ` +
2117
2333
  "and user's authored actions), which only user:<verb> or user:* grants.", "warning");
2118
2334
  return;
@@ -2248,8 +2464,8 @@ function checkRosterReads(roles, report) {
2248
2464
  * action that no role grants is a warning. Generated actions are not warned about: they stay closed
2249
2465
  * until a role grants them.
2250
2466
  */
2251
- function checkPermissions(entities, roles, workflows, report, authoredRoles = roles) {
2252
- const verbs = knownVerbs(entities);
2467
+ function checkPermissions(entities, roles, workflows, report, authoredRoles = roles, toolsets = []) {
2468
+ const verbs = knownVerbs(entities, toolsets);
2253
2469
  const workflowNames = new Set(workflows.map((candidate) => candidate.name));
2254
2470
  for (const candidate of authoredRoles) {
2255
2471
  checkRolePermissions(candidate, verbs, workflowNames, report);
@@ -2540,6 +2756,11 @@ function checkScope(input) {
2540
2756
  return;
2541
2757
  }
2542
2758
  const entity = entities.find((candidate) => candidate.name === parsed.entity);
2759
+ if (entity === undefined && verbs.get(parsed.entity)?.has(parsed.verb) === true) {
2760
+ report("invalid-scope", path, `${parsed.entity} is a toolset, which has no records to scope; list ${permission} as a ` +
2761
+ "string in the roles that may call the tool.");
2762
+ return;
2763
+ }
2543
2764
  if (entity === undefined || verbs.get(parsed.entity)?.has(parsed.verb) !== true) {
2544
2765
  return;
2545
2766
  }
package/dist/bin/check.js CHANGED
@@ -16,6 +16,7 @@ export function catalogSummary(manifest) {
16
16
  const actions = manifest.entities.flatMap((entity) => entity.actions.map((action) => `${entity.name}.${action.name}`));
17
17
  const roles = manifest.roles.map((role) => role.name);
18
18
  const workflows = (manifest.workflows ?? []).map((workflow) => workflow.name);
19
+ const tools = (manifest.toolsets ?? []).flatMap((toolset) => toolset.tools.map((tool) => `${toolset.name}_${tool.name} (${tool.access})`));
19
20
  return [
20
21
  `Entities: ${listed(entities.length, entities)}`,
21
22
  `Properties: ${properties}`,
@@ -31,6 +32,7 @@ export function catalogSummary(manifest) {
31
32
  `builders: ${manifest.feedback.builders.join(", ") || "none"}`,
32
33
  ]),
33
34
  ...(workflows.length > 0 ? [`Workflows: ${listed(workflows.length, workflows)}`] : []),
35
+ ...(tools.length > 0 ? [`Toolset tools: ${listed(tools.length, tools)}`] : []),
34
36
  `Manifest hash: ${manifest.hash}`,
35
37
  "",
36
38
  ].join("\n");
package/dist/chat.d.ts CHANGED
@@ -32,10 +32,26 @@ export interface ChatPreview {
32
32
  }
33
33
  export declare const chatOperationId: (sessionId: string, callId: string) => string;
34
34
  export declare const chatPreviewDigest: (preview: ChatPreview) => string;
35
+ /** A member's approval of a reply the agent held for review: the draft, or their edit of it. */
36
+ export interface ReviewSendInput {
37
+ /** The `agent_review` record's id. */
38
+ readonly review: string;
39
+ readonly text?: string;
40
+ }
41
+ /** What sending an approved reply did; `duplicate` when an earlier approval already sent it. */
42
+ export interface ReviewSendResult {
43
+ readonly status: "sent" | "uncertain" | "failed";
44
+ /** The text sent, or attempted. */
45
+ readonly text: string;
46
+ readonly messageId: string | null;
47
+ readonly duplicate: boolean;
48
+ }
35
49
  declare const ChatDelivery_base: Context.ServiceClass<ChatDelivery, "@segmentstream/ontology/ChatDelivery", {
36
50
  readonly preview: (input: ChatPostInput) => Effect.Effect<ChatPreview, ActionError>;
37
51
  readonly validate: (input: ChatPostInput) => Effect.Effect<void, ActionError>;
38
52
  readonly post: (input: ChatPostInput) => Effect.Effect<ChatPostResult, ActionError>;
53
+ /** Sends a reply a member approved, as the agent and without attribution, at most once. */
54
+ readonly sendReview?: (input: ReviewSendInput) => Effect.Effect<ReviewSendResult, ActionError>;
39
55
  }>;
40
56
  /** Deliver the exact Markdown source through the channel renderer, without invoking an agent. */
41
57
  export declare class ChatDelivery extends ChatDelivery_base {
@@ -1,10 +1,10 @@
1
1
  import { Schema } from "effect";
2
- export declare const DIAGNOSTIC_CODES: readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"];
2
+ export declare const DIAGNOSTIC_CODES: readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"];
3
3
  export type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[number];
4
4
  /** A problem `check` found in an ontology definition. */
5
5
  export declare const Diagnostic: Schema.Struct<{
6
6
  readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
7
- readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"]>;
7
+ readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"]>;
8
8
  /** Where the problem is, for example `lead.properties.status.options[1]`. */
9
9
  readonly path: Schema.String;
10
10
  readonly message: Schema.String;
@@ -14,7 +14,7 @@ declare const InvalidOntology_base: Schema.Class<InvalidOntology, Schema.TaggedS
14
14
  readonly message: Schema.String;
15
15
  readonly diagnostics: Schema.$Array<Schema.Struct<{
16
16
  readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
17
- readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"]>;
17
+ readonly code: Schema.Literals<readonly ["invalid-source", "missing-column", "invalid-column", "invalid-scope", "invalid-scope-path", "scope-reads-all", "scope-unused", "scope-member-overlap", "source-with-actions", "source-with-index", "invalid-metric", "unknown-metric", "circular-metric", "invalid-join", "missing-join", "invalid-entity", "invalid-property", "invalid-relationship", "invalid-actions", "invalid-action", "invalid-action-input", "invalid-role", "invalid-name", "reserved-name", "duplicate-name", "invalid-entity-id", "duplicate-entity-id", "missing-label", "missing-description", "invalid-title", "invalid-options", "invalid-default", "invalid-constraint", "unknown-relationship-target", "inverse-collision", "invalid-on-delete", "invalid-phrase", "invalid-index", "unknown-reference", "invalid-renamed-from", "earlier-name", "invalid-guide", "invalid-writes", "generated-update-empty", "managed-without-effect", "missing-permissions", "invalid-permission", "unknown-permission", "removed-allow", "unreachable-action", "wildcard-permission", "invalid-sign-in", "invalid-connection", "invalid-feedback", "invalid-discovery", "invalid-email", "feedback-unanswerable", "unknown-connection", "unused-connection", "invalid-prepare", "invalid-tool-name", "invalid-toolset", "toolset-lock-mismatch", "invalid-alignment", "single-entity-model-metric", "invalid-workflow", "workflow_role_unknown", "workflow_role_is_member", "workflow_role_grants_nothing", "workflow_role_wildcard", "workflow_role_scoped", "workflow_cron_never_fires", "workflow_input_invalid", "workflow_cron_invalid", "workflow_run_missing", "invalid-trigger", "trigger_action_unknown", "trigger_function_async", "workflow_trigger_limit_exceeded", "workflow_webhook_duplicate", "workflow_webhook_input_invalid", "workflow_webhook_mixed_triggers", "workflow_webhook_signature_invalid", "workflow_webhook_verification_invalid", "workflow_webhook_headers_invalid", "workflow_webhook_limit_exceeded"]>;
18
18
  /** Where the problem is, for example `lead.properties.status.options[1]`. */
19
19
  readonly path: Schema.String;
20
20
  readonly message: Schema.String;
@@ -61,6 +61,8 @@ export const DIAGNOSTIC_CODES = [
61
61
  "unused-connection",
62
62
  "invalid-prepare",
63
63
  "invalid-tool-name",
64
+ "invalid-toolset",
65
+ "toolset-lock-mismatch",
64
66
  "invalid-alignment",
65
67
  "single-entity-model-metric",
66
68
  "invalid-workflow",
package/dist/index.d.ts CHANGED
@@ -18,6 +18,8 @@ export type { DiscoveryOptions, EntityPermissions, JsonSchemaObject, MemberOptio
18
18
  export { Diagnostic, DIAGNOSTIC_CODES, formatDiagnostics, InvalidOntology } from "./diagnostics.js";
19
19
  export type { DiagnosticCode } from "./diagnostics.js";
20
20
  export { entity, isEntity } from "./entity.js";
21
+ export { isToolset, MCP_TOOL_NAME, TOOLSET_LOCK_VERSION, toolset, ToolsetLock, ToolsetLockTool, } from "./toolset.js";
22
+ export type { FixedValue, ResolvedTool, ResolvedToolset, Toolset, ToolsetDefinition, ToolsetToolOptions, } from "./toolset.js";
21
23
  export type { ActionsBuilder, AnyEntity, ActionHandle, ActionInvoker, MetricQueryGroupKey, AnyStoredEntity, BatchCreateValues, BatchKey, BatchUpdateRecord, BatchUpdateValues, BatchUpsertValues, CreateValues, DraftEntity, Entity, EntityDefinition, EntityRecord, EntityWrites, FreshMetricQueryInput, FreshMetricQueryRow, IndexDefinition, IndexField, InvocableActions, NoActions, Properties, RecordRef, Relationships, SystemFields, UpdateValues, } from "./entity.js";
22
24
  export { ActionRejected, BatchErrorDetails, Conflict, DeploymentInterrupted, DeploymentSwitching, LimitErrorDetails, NotFound, PermissionDenied, ScopeViolated, } from "./errors.js";
23
25
  export type { ActionError } from "./errors.js";
@@ -55,10 +57,12 @@ export type { BatchOptions, BatchRecordResult, BatchResult, BatchReturning, Batc
55
57
  export { User } from "./user.js";
56
58
  export type { UserHandle, UserMemberWrites } from "./user.js";
57
59
  export { AgentChat } from "./agent-chat.js";
60
+ export { AgentReview, AGENT_REVIEW_MODES, AGENT_REVIEW_STATUSES, AGENT_REVIEW_TEXT_LIMIT, } from "./agent-review.js";
58
61
  export { ATTACHABLE_IDENTITY_PROVIDERS, UserIdentity, USER_IDENTITY_ORIGINS, } from "./user-identity.js";
59
62
  export type { AttachableIdentityProvider, UserIdentityOrigin } from "./user-identity.js";
60
63
  export { AppFeedback, AppFeedbackFile, APP_FEEDBACK_ENTITIES, APP_FEEDBACK_FILE_MAX_BYTES, } from "./app-feedback.js";
61
64
  export { ChatDelivery, ChatPostInput, ChatPostResult } from "./chat.js";
65
+ export type { ReviewSendInput, ReviewSendResult } from "./chat.js";
62
66
  export { DEFAULT_QUERY_LIMIT, entityQueryResultSchema, entityQuerySchema, entityQuerySchemas, entityRecordSchema, FILTER_OPERATORS, LIST_FILTER_OPERATORS, MANY_QUANTIFIERS, MAX_IN_VALUES, MAX_QUERY_LIMIT, OrderBy, Query, queryFields, queryJsonSchema, queryLinks, QueryResult, queryResultJsonSchema, queryResultSchema, SortDirection, WHERE_COMBINATORS, } from "./query.js";
63
67
  export type { EntityQuerySchemas, FieldFilter, FilterOperator, JsonRecord, ListFilterOperator, ManyFilter, QueryField, QueryLink, StorageType, Where, } from "./query.js";
64
68
  export { InvalidQuery, InvalidValues, MemberNotFound, PrincipalRejected, StoredRecordMismatch, UnknownAction, UnknownRole, ValidationIssue, UndeclaredWrite, WriteOutsideAction, } from "./runtime/errors.js";
@@ -82,7 +86,7 @@ export { configFromEnv, ENVIRONMENT_VARIABLES, NEON_AUTH_ENVIRONMENT_VARIABLES,
82
86
  export type { ActionCommitted, AfterCommitHook, NeonAuthEnvironment, OntologyEnvironment, OntologyServiceConfig, } from "./service/config.js";
83
87
  export type { Decide, DecisionRequest } from "./service/decisions.js";
84
88
  export { IdentityInUse, NotInvited, OntologyBackend } from "./service/runtime-contract.js";
85
- export type { AgentIdentity, AgentMember, AgentLimits, AgentLimitScope, ChannelSignInInput, AgentResolution, ResolveIdentityInput, AgentPairing, AgentStore, SeenChat, GeneratedActionsProvider, IdentityProvider, OAuthClient, OAuthClientAuthMethod, OAuthGrant, OAuthDevice, DevicePoll, OAuthRequest, OAuthStore, OAuthToken, OAuthTokenKind, OntologyServiceRuntime, RunActionInput, SignInIdentity, UsedOAuthToken, } from "./service/runtime-contract.js";
89
+ export type { AgentIdentity, AgentMember, AgentLimits, AgentLimitScope, ChannelSignInInput, AgentResolution, ResolveIdentityInput, AgentPairing, AgentStore, SeenChat, HeldReplyInput, HeldReview, GeneratedActionsProvider, IdentityProvider, OAuthClient, OAuthClientAuthMethod, OAuthGrant, OAuthDevice, DevicePoll, OAuthRequest, OAuthStore, OAuthToken, OAuthTokenKind, OntologyServiceRuntime, RunActionInput, SignInIdentity, UsedOAuthToken, } from "./service/runtime-contract.js";
86
90
  export { createOntologyService, ONTOLOGY_HASH_HEADER, REQUEST_ID_HEADER, } from "./service/service.js";
87
91
  export { AGENT_PATH } from "./service/agent/server.js";
88
92
  export { AGENT_TASK_PATH, AGENT_TASK_RESULT_PATH } from "./service/agent/tasks.js";
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export { ActionConfirmation, ConfirmationFact } from "./confirmation.js";
10
10
  export { CONNECTION_ERROR_REASONS, CONNECTION_KEY, CONNECTION_METHODS, connection, ConnectionError, Connections, ConnectionTransport, isConnection, MAXIMUM_CONNECTION_BODY_BYTES, MAXIMUM_CONNECTION_RESPONSE_BYTES, } from "./connection.js";
11
11
  export { Diagnostic, DIAGNOSTIC_CODES, formatDiagnostics, InvalidOntology } from "./diagnostics.js";
12
12
  export { entity, isEntity } from "./entity.js";
13
+ export { isToolset, MCP_TOOL_NAME, TOOLSET_LOCK_VERSION, toolset, ToolsetLock, ToolsetLockTool, } from "./toolset.js";
13
14
  export { ActionRejected, BatchErrorDetails, Conflict, DeploymentInterrupted, DeploymentSwitching, LimitErrorDetails, NotFound, PermissionDenied, ScopeViolated, } from "./errors.js";
14
15
  export { browserAuthenticationCompatible } from "./manifest-compatibility.js";
15
16
  export { ActionManifest, actionConnectionKeys, canonicalJson, ConnectionManifest, EntityManifest, EntityPermissionsManifest, decodeManifestDocument, encodeManifest, formatManifest, IndexManifest, isValueMatched, MANIFEST_VERSION, manifestHash, ModelMetricManifest, OntologyManifest, OntologyManifestWire, PropertyManifest, RelationshipManifest, RoleManifest, ActionTriggerManifest, ScopeManifest, CronTriggerManifest, isActionTrigger, isCronTrigger, isWebhookTrigger, OtherTriggerManifest, WebhookTriggerManifest, WorkflowManifest, WorkflowTriggerManifest, SelectOptionManifest, SignInManifest, signInPolicyOf, channelPolicyOf, signUpRolesOf, } from "./manifest.js";
@@ -29,6 +30,7 @@ export { CHANNEL_PROVIDERS, DEFAULT_SIGN_IN_POLICY, SIGN_IN_METHODS, SIGN_IN_POL
29
30
  export { OntologyActions, OntologyReads, OntologyRuntime, OntologyWrites } from "./runtime.js";
30
31
  export { User } from "./user.js";
31
32
  export { AgentChat } from "./agent-chat.js";
33
+ export { AgentReview, AGENT_REVIEW_MODES, AGENT_REVIEW_STATUSES, AGENT_REVIEW_TEXT_LIMIT, } from "./agent-review.js";
32
34
  export { ATTACHABLE_IDENTITY_PROVIDERS, UserIdentity, USER_IDENTITY_ORIGINS, } from "./user-identity.js";
33
35
  export { AppFeedback, AppFeedbackFile, APP_FEEDBACK_ENTITIES, APP_FEEDBACK_FILE_MAX_BYTES, } from "./app-feedback.js";
34
36
  export { ChatDelivery, ChatPostInput, ChatPostResult } from "./chat.js";