@objectstack/service-ai 7.2.1 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +86 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -39
- package/dist/index.d.ts +19 -39
- package/dist/index.js +86 -76
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -868,7 +868,7 @@ declare const createObjectTool: {
|
|
|
868
868
|
_packageId?: string | undefined;
|
|
869
869
|
_packageVersion?: string | undefined;
|
|
870
870
|
_lockDocsUrl?: string | undefined;
|
|
871
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
871
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
872
872
|
outputSchema?: Record<string, unknown> | undefined;
|
|
873
873
|
objectName?: string | undefined;
|
|
874
874
|
permissions?: string[] | undefined;
|
|
@@ -901,7 +901,7 @@ declare const addFieldTool: {
|
|
|
901
901
|
_packageId?: string | undefined;
|
|
902
902
|
_packageVersion?: string | undefined;
|
|
903
903
|
_lockDocsUrl?: string | undefined;
|
|
904
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
904
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
905
905
|
outputSchema?: Record<string, unknown> | undefined;
|
|
906
906
|
objectName?: string | undefined;
|
|
907
907
|
permissions?: string[] | undefined;
|
|
@@ -933,7 +933,7 @@ declare const modifyFieldTool: {
|
|
|
933
933
|
_packageId?: string | undefined;
|
|
934
934
|
_packageVersion?: string | undefined;
|
|
935
935
|
_lockDocsUrl?: string | undefined;
|
|
936
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
936
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
937
937
|
outputSchema?: Record<string, unknown> | undefined;
|
|
938
938
|
objectName?: string | undefined;
|
|
939
939
|
permissions?: string[] | undefined;
|
|
@@ -965,7 +965,7 @@ declare const deleteFieldTool: {
|
|
|
965
965
|
_packageId?: string | undefined;
|
|
966
966
|
_packageVersion?: string | undefined;
|
|
967
967
|
_lockDocsUrl?: string | undefined;
|
|
968
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
968
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
969
969
|
outputSchema?: Record<string, unknown> | undefined;
|
|
970
970
|
objectName?: string | undefined;
|
|
971
971
|
permissions?: string[] | undefined;
|
|
@@ -998,7 +998,7 @@ declare const listObjectsTool: {
|
|
|
998
998
|
_packageId?: string | undefined;
|
|
999
999
|
_packageVersion?: string | undefined;
|
|
1000
1000
|
_lockDocsUrl?: string | undefined;
|
|
1001
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1001
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1002
1002
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1003
1003
|
objectName?: string | undefined;
|
|
1004
1004
|
permissions?: string[] | undefined;
|
|
@@ -1031,7 +1031,7 @@ declare const describeObjectTool: {
|
|
|
1031
1031
|
_packageId?: string | undefined;
|
|
1032
1032
|
_packageVersion?: string | undefined;
|
|
1033
1033
|
_lockDocsUrl?: string | undefined;
|
|
1034
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1034
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1035
1035
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1036
1036
|
objectName?: string | undefined;
|
|
1037
1037
|
permissions?: string[] | undefined;
|
|
@@ -1147,7 +1147,7 @@ declare const listPackagesTool: {
|
|
|
1147
1147
|
_packageId?: string | undefined;
|
|
1148
1148
|
_packageVersion?: string | undefined;
|
|
1149
1149
|
_lockDocsUrl?: string | undefined;
|
|
1150
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1150
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1151
1151
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1152
1152
|
objectName?: string | undefined;
|
|
1153
1153
|
permissions?: string[] | undefined;
|
|
@@ -1178,7 +1178,7 @@ declare const getPackageTool: {
|
|
|
1178
1178
|
_packageId?: string | undefined;
|
|
1179
1179
|
_packageVersion?: string | undefined;
|
|
1180
1180
|
_lockDocsUrl?: string | undefined;
|
|
1181
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1181
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1182
1182
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1183
1183
|
objectName?: string | undefined;
|
|
1184
1184
|
permissions?: string[] | undefined;
|
|
@@ -1210,7 +1210,7 @@ declare const createPackageTool: {
|
|
|
1210
1210
|
_packageId?: string | undefined;
|
|
1211
1211
|
_packageVersion?: string | undefined;
|
|
1212
1212
|
_lockDocsUrl?: string | undefined;
|
|
1213
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1213
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1214
1214
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1215
1215
|
objectName?: string | undefined;
|
|
1216
1216
|
permissions?: string[] | undefined;
|
|
@@ -1241,7 +1241,7 @@ declare const getActivePackageTool: {
|
|
|
1241
1241
|
_packageId?: string | undefined;
|
|
1242
1242
|
_packageVersion?: string | undefined;
|
|
1243
1243
|
_lockDocsUrl?: string | undefined;
|
|
1244
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1244
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1245
1245
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1246
1246
|
objectName?: string | undefined;
|
|
1247
1247
|
permissions?: string[] | undefined;
|
|
@@ -1273,7 +1273,7 @@ declare const setActivePackageTool: {
|
|
|
1273
1273
|
_packageId?: string | undefined;
|
|
1274
1274
|
_packageVersion?: string | undefined;
|
|
1275
1275
|
_lockDocsUrl?: string | undefined;
|
|
1276
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1276
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1277
1277
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1278
1278
|
objectName?: string | undefined;
|
|
1279
1279
|
permissions?: string[] | undefined;
|
|
@@ -1737,38 +1737,18 @@ declare class AgentRuntime {
|
|
|
1737
1737
|
* chat endpoint when the client doesn't specify an `agentName`.
|
|
1738
1738
|
*
|
|
1739
1739
|
* Resolution order:
|
|
1740
|
-
* 1. The `defaultAgent` of the app named by `context.appName
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1740
|
+
* 1. The `defaultAgent` of the app named by `context.appName`
|
|
1741
|
+
* (e.g. Studio → `metadata_assistant`).
|
|
1742
|
+
* 2. The platform data-query agent (`data_chat`) — the implicit
|
|
1743
|
+
* copilot bound to every app that doesn't pin its own. This is
|
|
1744
|
+
* what end users get by default, so they never have to choose.
|
|
1745
|
+
* 3. The first active agent in the registry (last-resort fallback,
|
|
1746
|
+
* e.g. in stripped-down deployments without the data agent).
|
|
1747
|
+
* 4. `undefined` if no agents are registered.
|
|
1743
1748
|
*/
|
|
1744
1749
|
resolveDefaultAgent(context?: AgentChatContext): Promise<Agent | undefined>;
|
|
1745
1750
|
}
|
|
1746
1751
|
|
|
1747
|
-
/**
|
|
1748
|
-
* Built-in `data_chat` agent — a thin **persona** record.
|
|
1749
|
-
*
|
|
1750
|
-
* Following the platform's metadata-driven philosophy, this agent no
|
|
1751
|
-
* longer hardcodes the tools it can call. The capability bundle lives
|
|
1752
|
-
* on the `data_explorer` *skill* (see `../skills/data-explorer-skill.ts`).
|
|
1753
|
-
* The agent record is now just:
|
|
1754
|
-
* - identity (name / label / role)
|
|
1755
|
-
* - persona (system prompt)
|
|
1756
|
-
* - model + safety config
|
|
1757
|
-
* - skills attached → `skills: ['data_explorer']`
|
|
1758
|
-
*
|
|
1759
|
-
* To grant data-exploration powers to a different agent, just add
|
|
1760
|
-
* `data_explorer` to its `skills[]`. To revoke globally, set the
|
|
1761
|
-
* skill's `active: false` in metadata.
|
|
1762
|
-
*
|
|
1763
|
-
* @example
|
|
1764
|
-
* ```
|
|
1765
|
-
* POST /api/v1/ai/agents/data_chat/chat
|
|
1766
|
-
* {
|
|
1767
|
-
* "messages": [{ "role": "user", "content": "Show me all active accounts" }],
|
|
1768
|
-
* "context": { "objectName": "account" }
|
|
1769
|
-
* }
|
|
1770
|
-
* ```
|
|
1771
|
-
*/
|
|
1772
1752
|
declare const DATA_CHAT_AGENT: Agent;
|
|
1773
1753
|
|
|
1774
1754
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -868,7 +868,7 @@ declare const createObjectTool: {
|
|
|
868
868
|
_packageId?: string | undefined;
|
|
869
869
|
_packageVersion?: string | undefined;
|
|
870
870
|
_lockDocsUrl?: string | undefined;
|
|
871
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
871
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
872
872
|
outputSchema?: Record<string, unknown> | undefined;
|
|
873
873
|
objectName?: string | undefined;
|
|
874
874
|
permissions?: string[] | undefined;
|
|
@@ -901,7 +901,7 @@ declare const addFieldTool: {
|
|
|
901
901
|
_packageId?: string | undefined;
|
|
902
902
|
_packageVersion?: string | undefined;
|
|
903
903
|
_lockDocsUrl?: string | undefined;
|
|
904
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
904
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
905
905
|
outputSchema?: Record<string, unknown> | undefined;
|
|
906
906
|
objectName?: string | undefined;
|
|
907
907
|
permissions?: string[] | undefined;
|
|
@@ -933,7 +933,7 @@ declare const modifyFieldTool: {
|
|
|
933
933
|
_packageId?: string | undefined;
|
|
934
934
|
_packageVersion?: string | undefined;
|
|
935
935
|
_lockDocsUrl?: string | undefined;
|
|
936
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
936
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
937
937
|
outputSchema?: Record<string, unknown> | undefined;
|
|
938
938
|
objectName?: string | undefined;
|
|
939
939
|
permissions?: string[] | undefined;
|
|
@@ -965,7 +965,7 @@ declare const deleteFieldTool: {
|
|
|
965
965
|
_packageId?: string | undefined;
|
|
966
966
|
_packageVersion?: string | undefined;
|
|
967
967
|
_lockDocsUrl?: string | undefined;
|
|
968
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
968
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
969
969
|
outputSchema?: Record<string, unknown> | undefined;
|
|
970
970
|
objectName?: string | undefined;
|
|
971
971
|
permissions?: string[] | undefined;
|
|
@@ -998,7 +998,7 @@ declare const listObjectsTool: {
|
|
|
998
998
|
_packageId?: string | undefined;
|
|
999
999
|
_packageVersion?: string | undefined;
|
|
1000
1000
|
_lockDocsUrl?: string | undefined;
|
|
1001
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1001
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1002
1002
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1003
1003
|
objectName?: string | undefined;
|
|
1004
1004
|
permissions?: string[] | undefined;
|
|
@@ -1031,7 +1031,7 @@ declare const describeObjectTool: {
|
|
|
1031
1031
|
_packageId?: string | undefined;
|
|
1032
1032
|
_packageVersion?: string | undefined;
|
|
1033
1033
|
_lockDocsUrl?: string | undefined;
|
|
1034
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1034
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1035
1035
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1036
1036
|
objectName?: string | undefined;
|
|
1037
1037
|
permissions?: string[] | undefined;
|
|
@@ -1147,7 +1147,7 @@ declare const listPackagesTool: {
|
|
|
1147
1147
|
_packageId?: string | undefined;
|
|
1148
1148
|
_packageVersion?: string | undefined;
|
|
1149
1149
|
_lockDocsUrl?: string | undefined;
|
|
1150
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1150
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1151
1151
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1152
1152
|
objectName?: string | undefined;
|
|
1153
1153
|
permissions?: string[] | undefined;
|
|
@@ -1178,7 +1178,7 @@ declare const getPackageTool: {
|
|
|
1178
1178
|
_packageId?: string | undefined;
|
|
1179
1179
|
_packageVersion?: string | undefined;
|
|
1180
1180
|
_lockDocsUrl?: string | undefined;
|
|
1181
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1181
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1182
1182
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1183
1183
|
objectName?: string | undefined;
|
|
1184
1184
|
permissions?: string[] | undefined;
|
|
@@ -1210,7 +1210,7 @@ declare const createPackageTool: {
|
|
|
1210
1210
|
_packageId?: string | undefined;
|
|
1211
1211
|
_packageVersion?: string | undefined;
|
|
1212
1212
|
_lockDocsUrl?: string | undefined;
|
|
1213
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1213
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1214
1214
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1215
1215
|
objectName?: string | undefined;
|
|
1216
1216
|
permissions?: string[] | undefined;
|
|
@@ -1241,7 +1241,7 @@ declare const getActivePackageTool: {
|
|
|
1241
1241
|
_packageId?: string | undefined;
|
|
1242
1242
|
_packageVersion?: string | undefined;
|
|
1243
1243
|
_lockDocsUrl?: string | undefined;
|
|
1244
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1244
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1245
1245
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1246
1246
|
objectName?: string | undefined;
|
|
1247
1247
|
permissions?: string[] | undefined;
|
|
@@ -1273,7 +1273,7 @@ declare const setActivePackageTool: {
|
|
|
1273
1273
|
_packageId?: string | undefined;
|
|
1274
1274
|
_packageVersion?: string | undefined;
|
|
1275
1275
|
_lockDocsUrl?: string | undefined;
|
|
1276
|
-
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "
|
|
1276
|
+
category?: "action" | "flow" | "vector_search" | "data" | "utility" | "integration" | "analytics" | undefined;
|
|
1277
1277
|
outputSchema?: Record<string, unknown> | undefined;
|
|
1278
1278
|
objectName?: string | undefined;
|
|
1279
1279
|
permissions?: string[] | undefined;
|
|
@@ -1737,38 +1737,18 @@ declare class AgentRuntime {
|
|
|
1737
1737
|
* chat endpoint when the client doesn't specify an `agentName`.
|
|
1738
1738
|
*
|
|
1739
1739
|
* Resolution order:
|
|
1740
|
-
* 1. The `defaultAgent` of the app named by `context.appName
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1740
|
+
* 1. The `defaultAgent` of the app named by `context.appName`
|
|
1741
|
+
* (e.g. Studio → `metadata_assistant`).
|
|
1742
|
+
* 2. The platform data-query agent (`data_chat`) — the implicit
|
|
1743
|
+
* copilot bound to every app that doesn't pin its own. This is
|
|
1744
|
+
* what end users get by default, so they never have to choose.
|
|
1745
|
+
* 3. The first active agent in the registry (last-resort fallback,
|
|
1746
|
+
* e.g. in stripped-down deployments without the data agent).
|
|
1747
|
+
* 4. `undefined` if no agents are registered.
|
|
1743
1748
|
*/
|
|
1744
1749
|
resolveDefaultAgent(context?: AgentChatContext): Promise<Agent | undefined>;
|
|
1745
1750
|
}
|
|
1746
1751
|
|
|
1747
|
-
/**
|
|
1748
|
-
* Built-in `data_chat` agent — a thin **persona** record.
|
|
1749
|
-
*
|
|
1750
|
-
* Following the platform's metadata-driven philosophy, this agent no
|
|
1751
|
-
* longer hardcodes the tools it can call. The capability bundle lives
|
|
1752
|
-
* on the `data_explorer` *skill* (see `../skills/data-explorer-skill.ts`).
|
|
1753
|
-
* The agent record is now just:
|
|
1754
|
-
* - identity (name / label / role)
|
|
1755
|
-
* - persona (system prompt)
|
|
1756
|
-
* - model + safety config
|
|
1757
|
-
* - skills attached → `skills: ['data_explorer']`
|
|
1758
|
-
*
|
|
1759
|
-
* To grant data-exploration powers to a different agent, just add
|
|
1760
|
-
* `data_explorer` to its `skills[]`. To revoke globally, set the
|
|
1761
|
-
* skill's `active: false` in metadata.
|
|
1762
|
-
*
|
|
1763
|
-
* @example
|
|
1764
|
-
* ```
|
|
1765
|
-
* POST /api/v1/ai/agents/data_chat/chat
|
|
1766
|
-
* {
|
|
1767
|
-
* "messages": [{ "role": "user", "content": "Show me all active accounts" }],
|
|
1768
|
-
* "context": { "objectName": "account" }
|
|
1769
|
-
* }
|
|
1770
|
-
* ```
|
|
1771
|
-
*/
|
|
1772
1752
|
declare const DATA_CHAT_AGENT: Agent;
|
|
1773
1753
|
|
|
1774
1754
|
/**
|
package/dist/index.js
CHANGED
|
@@ -5718,6 +5718,82 @@ async function registerActionsAsTools(registry, context) {
|
|
|
5718
5718
|
|
|
5719
5719
|
// src/agent-runtime.ts
|
|
5720
5720
|
import { AgentSchema } from "@objectstack/spec/ai";
|
|
5721
|
+
|
|
5722
|
+
// src/agents/data-chat-agent.ts
|
|
5723
|
+
var DEFAULT_DATA_AGENT_NAME = "data_chat";
|
|
5724
|
+
var DATA_CHAT_AGENT = {
|
|
5725
|
+
name: DEFAULT_DATA_AGENT_NAME,
|
|
5726
|
+
label: "Data Assistant",
|
|
5727
|
+
role: "Business Data Analyst",
|
|
5728
|
+
instructions: `You are a helpful data assistant that helps users explore and understand their business data through natural language.
|
|
5729
|
+
|
|
5730
|
+
Always answer in the same language the user is using. Detailed tool-usage guidance is supplied by the skills attached to this agent.`,
|
|
5731
|
+
model: {
|
|
5732
|
+
provider: "openai",
|
|
5733
|
+
model: "gpt-4",
|
|
5734
|
+
temperature: 0.3,
|
|
5735
|
+
maxTokens: 4096
|
|
5736
|
+
},
|
|
5737
|
+
// Capability bundle lives on the skill; the agent only references it.
|
|
5738
|
+
// `data_explorer` = read side, `actions_executor` = write side.
|
|
5739
|
+
skills: ["data_explorer", "actions_executor"],
|
|
5740
|
+
active: true,
|
|
5741
|
+
visibility: "global",
|
|
5742
|
+
guardrails: {
|
|
5743
|
+
maxTokensPerInvocation: 8192,
|
|
5744
|
+
maxExecutionTimeSec: 30,
|
|
5745
|
+
blockedTopics: ["delete_records", "drop_table", "alter_schema"]
|
|
5746
|
+
},
|
|
5747
|
+
planning: {
|
|
5748
|
+
strategy: "react",
|
|
5749
|
+
maxIterations: 5,
|
|
5750
|
+
allowReplan: false
|
|
5751
|
+
},
|
|
5752
|
+
memory: {
|
|
5753
|
+
shortTerm: {
|
|
5754
|
+
maxMessages: 20,
|
|
5755
|
+
maxTokens: 4096
|
|
5756
|
+
}
|
|
5757
|
+
}
|
|
5758
|
+
};
|
|
5759
|
+
|
|
5760
|
+
// src/agents/metadata-assistant-agent.ts
|
|
5761
|
+
var METADATA_ASSISTANT_AGENT = {
|
|
5762
|
+
name: "metadata_assistant",
|
|
5763
|
+
label: "Metadata Assistant",
|
|
5764
|
+
role: "Schema Architect",
|
|
5765
|
+
instructions: `You are an expert metadata architect that helps users design and manage their data models through natural language.
|
|
5766
|
+
|
|
5767
|
+
Always answer in the same language the user is using. If the user's request is ambiguous, ask clarifying questions before proceeding. Detailed tool-usage guidance is supplied by the skills attached to this agent.`,
|
|
5768
|
+
model: {
|
|
5769
|
+
provider: "openai",
|
|
5770
|
+
model: "gpt-4",
|
|
5771
|
+
temperature: 0.2,
|
|
5772
|
+
maxTokens: 4096
|
|
5773
|
+
},
|
|
5774
|
+
// Capability bundle lives on the skill; the agent only references it.
|
|
5775
|
+
skills: ["metadata_authoring"],
|
|
5776
|
+
active: true,
|
|
5777
|
+
visibility: "global",
|
|
5778
|
+
guardrails: {
|
|
5779
|
+
maxTokensPerInvocation: 8192,
|
|
5780
|
+
maxExecutionTimeSec: 60,
|
|
5781
|
+
blockedTopics: ["drop_database", "raw_sql", "system_tables"]
|
|
5782
|
+
},
|
|
5783
|
+
planning: {
|
|
5784
|
+
strategy: "react",
|
|
5785
|
+
maxIterations: 10,
|
|
5786
|
+
allowReplan: true
|
|
5787
|
+
},
|
|
5788
|
+
memory: {
|
|
5789
|
+
shortTerm: {
|
|
5790
|
+
maxMessages: 30,
|
|
5791
|
+
maxTokens: 8192
|
|
5792
|
+
}
|
|
5793
|
+
}
|
|
5794
|
+
};
|
|
5795
|
+
|
|
5796
|
+
// src/agent-runtime.ts
|
|
5721
5797
|
var AgentRuntime = class {
|
|
5722
5798
|
constructor(metadataService, skillRegistry) {
|
|
5723
5799
|
this.metadataService = metadataService;
|
|
@@ -5868,9 +5944,14 @@ var AgentRuntime = class {
|
|
|
5868
5944
|
* chat endpoint when the client doesn't specify an `agentName`.
|
|
5869
5945
|
*
|
|
5870
5946
|
* Resolution order:
|
|
5871
|
-
* 1. The `defaultAgent` of the app named by `context.appName
|
|
5872
|
-
*
|
|
5873
|
-
*
|
|
5947
|
+
* 1. The `defaultAgent` of the app named by `context.appName`
|
|
5948
|
+
* (e.g. Studio → `metadata_assistant`).
|
|
5949
|
+
* 2. The platform data-query agent (`data_chat`) — the implicit
|
|
5950
|
+
* copilot bound to every app that doesn't pin its own. This is
|
|
5951
|
+
* what end users get by default, so they never have to choose.
|
|
5952
|
+
* 3. The first active agent in the registry (last-resort fallback,
|
|
5953
|
+
* e.g. in stripped-down deployments without the data agent).
|
|
5954
|
+
* 4. `undefined` if no agents are registered.
|
|
5874
5955
|
*/
|
|
5875
5956
|
async resolveDefaultAgent(context) {
|
|
5876
5957
|
if (context?.appName) {
|
|
@@ -5881,6 +5962,8 @@ var AgentRuntime = class {
|
|
|
5881
5962
|
if (agent && agent.active !== false) return agent;
|
|
5882
5963
|
}
|
|
5883
5964
|
}
|
|
5965
|
+
const dataAgent = await this.loadAgent(DEFAULT_DATA_AGENT_NAME);
|
|
5966
|
+
if (dataAgent && dataAgent.active !== false) return dataAgent;
|
|
5884
5967
|
const summaries = await this.listAgents();
|
|
5885
5968
|
if (summaries.length === 0) return void 0;
|
|
5886
5969
|
return this.loadAgent(summaries[0].name);
|
|
@@ -6076,79 +6159,6 @@ var SkillRegistry = class {
|
|
|
6076
6159
|
}
|
|
6077
6160
|
};
|
|
6078
6161
|
|
|
6079
|
-
// src/agents/data-chat-agent.ts
|
|
6080
|
-
var DATA_CHAT_AGENT = {
|
|
6081
|
-
name: "data_chat",
|
|
6082
|
-
label: "Data Assistant",
|
|
6083
|
-
role: "Business Data Analyst",
|
|
6084
|
-
instructions: `You are a helpful data assistant that helps users explore and understand their business data through natural language.
|
|
6085
|
-
|
|
6086
|
-
Always answer in the same language the user is using. Detailed tool-usage guidance is supplied by the skills attached to this agent.`,
|
|
6087
|
-
model: {
|
|
6088
|
-
provider: "openai",
|
|
6089
|
-
model: "gpt-4",
|
|
6090
|
-
temperature: 0.3,
|
|
6091
|
-
maxTokens: 4096
|
|
6092
|
-
},
|
|
6093
|
-
// Capability bundle lives on the skill; the agent only references it.
|
|
6094
|
-
// `data_explorer` = read side, `actions_executor` = write side.
|
|
6095
|
-
skills: ["data_explorer", "actions_executor"],
|
|
6096
|
-
active: true,
|
|
6097
|
-
visibility: "global",
|
|
6098
|
-
guardrails: {
|
|
6099
|
-
maxTokensPerInvocation: 8192,
|
|
6100
|
-
maxExecutionTimeSec: 30,
|
|
6101
|
-
blockedTopics: ["delete_records", "drop_table", "alter_schema"]
|
|
6102
|
-
},
|
|
6103
|
-
planning: {
|
|
6104
|
-
strategy: "react",
|
|
6105
|
-
maxIterations: 5,
|
|
6106
|
-
allowReplan: false
|
|
6107
|
-
},
|
|
6108
|
-
memory: {
|
|
6109
|
-
shortTerm: {
|
|
6110
|
-
maxMessages: 20,
|
|
6111
|
-
maxTokens: 4096
|
|
6112
|
-
}
|
|
6113
|
-
}
|
|
6114
|
-
};
|
|
6115
|
-
|
|
6116
|
-
// src/agents/metadata-assistant-agent.ts
|
|
6117
|
-
var METADATA_ASSISTANT_AGENT = {
|
|
6118
|
-
name: "metadata_assistant",
|
|
6119
|
-
label: "Metadata Assistant",
|
|
6120
|
-
role: "Schema Architect",
|
|
6121
|
-
instructions: `You are an expert metadata architect that helps users design and manage their data models through natural language.
|
|
6122
|
-
|
|
6123
|
-
Always answer in the same language the user is using. If the user's request is ambiguous, ask clarifying questions before proceeding. Detailed tool-usage guidance is supplied by the skills attached to this agent.`,
|
|
6124
|
-
model: {
|
|
6125
|
-
provider: "openai",
|
|
6126
|
-
model: "gpt-4",
|
|
6127
|
-
temperature: 0.2,
|
|
6128
|
-
maxTokens: 4096
|
|
6129
|
-
},
|
|
6130
|
-
// Capability bundle lives on the skill; the agent only references it.
|
|
6131
|
-
skills: ["metadata_authoring"],
|
|
6132
|
-
active: true,
|
|
6133
|
-
visibility: "global",
|
|
6134
|
-
guardrails: {
|
|
6135
|
-
maxTokensPerInvocation: 8192,
|
|
6136
|
-
maxExecutionTimeSec: 60,
|
|
6137
|
-
blockedTopics: ["drop_database", "raw_sql", "system_tables"]
|
|
6138
|
-
},
|
|
6139
|
-
planning: {
|
|
6140
|
-
strategy: "react",
|
|
6141
|
-
maxIterations: 10,
|
|
6142
|
-
allowReplan: true
|
|
6143
|
-
},
|
|
6144
|
-
memory: {
|
|
6145
|
-
shortTerm: {
|
|
6146
|
-
maxMessages: 30,
|
|
6147
|
-
maxTokens: 8192
|
|
6148
|
-
}
|
|
6149
|
-
}
|
|
6150
|
-
};
|
|
6151
|
-
|
|
6152
6162
|
// src/skills/data-explorer-skill.ts
|
|
6153
6163
|
var DATA_EXPLORER_SKILL = {
|
|
6154
6164
|
name: "data_explorer",
|