aui-agent-builder 0.1.78 → 0.1.80
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/bin/aui.js +1 -1
- package/dist/api-client/index.d.ts +1 -1
- package/dist/api-client/index.d.ts.map +1 -1
- package/dist/api-client/index.js +152 -184
- package/dist/api-client/index.js.map +1 -1
- package/dist/api-client/rag-client.js +16 -54
- package/dist/api-client/rag-client.js.map +1 -1
- package/dist/commands/account.d.ts +0 -3
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +127 -265
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/add-integration.d.ts.map +1 -1
- package/dist/commands/add-integration.js +62 -103
- package/dist/commands/add-integration.js.map +1 -1
- package/dist/commands/add-param.js +16 -55
- package/dist/commands/add-param.js.map +1 -1
- package/dist/commands/add-tool.js +27 -66
- package/dist/commands/add-tool.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +129 -227
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +252 -368
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/connect.js +33 -72
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/create-agent.d.ts +1 -1
- package/dist/commands/create-agent.d.ts.map +1 -1
- package/dist/commands/create-agent.js +3 -6
- package/dist/commands/create-agent.js.map +1 -1
- package/dist/commands/diff.d.ts +2 -7
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +30 -370
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/dvalidate.d.ts.map +1 -1
- package/dist/commands/dvalidate.js +43 -120
- package/dist/commands/dvalidate.js.map +1 -1
- package/dist/commands/env.d.ts +1 -6
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +21 -66
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/import-agent.d.ts.map +1 -1
- package/dist/commands/import-agent.js +131 -182
- package/dist/commands/import-agent.js.map +1 -1
- package/dist/commands/index.d.ts +16 -16
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +16 -35
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +34 -89
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list-agents.d.ts +0 -5
- package/dist/commands/list-agents.d.ts.map +1 -1
- package/dist/commands/list-agents.js +22 -59
- package/dist/commands/list-agents.js.map +1 -1
- package/dist/commands/login.d.ts +3 -6
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +311 -538
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/logout.js +7 -11
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/pull-schema.d.ts +2 -15
- package/dist/commands/pull-schema.d.ts.map +1 -1
- package/dist/commands/pull-schema.js +7 -224
- package/dist/commands/pull-schema.js.map +1 -1
- package/dist/commands/pull.js +16 -22
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts +0 -3
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +143 -312
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/rag.d.ts.map +1 -1
- package/dist/commands/rag.js +198 -329
- package/dist/commands/rag.js.map +1 -1
- package/dist/commands/serve.d.ts +11 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +42 -80
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +7 -148
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.js +21 -27
- package/dist/commands/sync.js.map +1 -1
- package/dist/config/index.js +35 -93
- package/dist/config/index.js.map +1 -1
- package/dist/index.js +44 -48
- package/dist/index.js.map +1 -1
- package/dist/services/account.service.d.ts +26 -0
- package/dist/services/account.service.d.ts.map +1 -0
- package/dist/services/account.service.js +105 -0
- package/dist/services/account.service.js.map +1 -0
- package/dist/services/agents.service.d.ts +20 -0
- package/dist/services/agents.service.d.ts.map +1 -0
- package/dist/services/agents.service.js +67 -0
- package/dist/services/agents.service.js.map +1 -0
- package/dist/services/auth.service.d.ts +76 -0
- package/dist/services/auth.service.d.ts.map +1 -0
- package/dist/services/auth.service.js +248 -0
- package/dist/services/auth.service.js.map +1 -0
- package/dist/services/diff.service.d.ts +78 -0
- package/dist/services/diff.service.d.ts.map +1 -0
- package/dist/services/diff.service.js +171 -0
- package/dist/services/diff.service.js.map +1 -0
- package/dist/services/env.service.d.ts +21 -0
- package/dist/services/env.service.d.ts.map +1 -0
- package/dist/services/env.service.js +47 -0
- package/dist/services/env.service.js.map +1 -0
- package/dist/services/list-agents.service.d.ts +8 -0
- package/dist/services/list-agents.service.d.ts.map +1 -0
- package/dist/services/list-agents.service.js +23 -0
- package/dist/services/list-agents.service.js.map +1 -0
- package/dist/services/pull-schema.service.d.ts +27 -0
- package/dist/services/pull-schema.service.d.ts.map +1 -0
- package/dist/services/pull-schema.service.js +163 -0
- package/dist/services/pull-schema.service.js.map +1 -0
- package/dist/services/rag.service.d.ts +74 -0
- package/dist/services/rag.service.d.ts.map +1 -0
- package/dist/services/rag.service.js +126 -0
- package/dist/services/rag.service.js.map +1 -0
- package/dist/services/status.service.d.ts +29 -0
- package/dist/services/status.service.d.ts.map +1 -0
- package/dist/services/status.service.js +102 -0
- package/dist/services/status.service.js.map +1 -0
- package/dist/telemetry.d.ts +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +17 -24
- package/dist/telemetry.js.map +1 -1
- package/dist/types/agent.d.ts +5 -5
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/agent.js +1 -2
- package/dist/types/agent.js.map +1 -1
- package/dist/types/base.js +1 -2
- package/dist/types/base.js.map +1 -1
- package/dist/types/entity.js +1 -2
- package/dist/types/entity.js.map +1 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +7 -23
- package/dist/types/index.js.map +1 -1
- package/dist/types/integration.d.ts +1 -1
- package/dist/types/integration.d.ts.map +1 -1
- package/dist/types/integration.js +1 -2
- package/dist/types/integration.js.map +1 -1
- package/dist/types/parameter.d.ts +1 -1
- package/dist/types/parameter.d.ts.map +1 -1
- package/dist/types/parameter.js +1 -2
- package/dist/types/parameter.js.map +1 -1
- package/dist/types/rule.d.ts +1 -1
- package/dist/types/rule.d.ts.map +1 -1
- package/dist/types/rule.js +1 -2
- package/dist/types/rule.js.map +1 -1
- package/dist/types/tool.d.ts +1 -1
- package/dist/types/tool.d.ts.map +1 -1
- package/dist/types/tool.js +1 -2
- package/dist/types/tool.js.map +1 -1
- package/dist/ui/components/Badge.d.ts +8 -0
- package/dist/ui/components/Badge.d.ts.map +1 -0
- package/dist/ui/components/Badge.js +7 -0
- package/dist/ui/components/Badge.js.map +1 -0
- package/dist/ui/components/Divider.d.ts +6 -0
- package/dist/ui/components/Divider.d.ts.map +1 -0
- package/dist/ui/components/Divider.js +7 -0
- package/dist/ui/components/Divider.js.map +1 -0
- package/dist/ui/components/ErrorDisplay.d.ts +7 -0
- package/dist/ui/components/ErrorDisplay.d.ts.map +1 -0
- package/dist/ui/components/ErrorDisplay.js +7 -0
- package/dist/ui/components/ErrorDisplay.js.map +1 -0
- package/dist/ui/components/Header.d.ts +8 -0
- package/dist/ui/components/Header.d.ts.map +1 -0
- package/dist/ui/components/Header.js +7 -0
- package/dist/ui/components/Header.js.map +1 -0
- package/dist/ui/components/Hint.d.ts +7 -0
- package/dist/ui/components/Hint.d.ts.map +1 -0
- package/dist/ui/components/Hint.js +7 -0
- package/dist/ui/components/Hint.js.map +1 -0
- package/dist/ui/components/KeyValue.d.ts +19 -0
- package/dist/ui/components/KeyValue.d.ts.map +1 -0
- package/dist/ui/components/KeyValue.js +12 -0
- package/dist/ui/components/KeyValue.js.map +1 -0
- package/dist/ui/components/Section.d.ts +9 -0
- package/dist/ui/components/Section.d.ts.map +1 -0
- package/dist/ui/components/Section.js +7 -0
- package/dist/ui/components/Section.js.map +1 -0
- package/dist/ui/components/Spinner.d.ts +6 -0
- package/dist/ui/components/Spinner.d.ts.map +1 -0
- package/dist/ui/components/Spinner.js +8 -0
- package/dist/ui/components/Spinner.js.map +1 -0
- package/dist/ui/components/StatusLine.d.ts +9 -0
- package/dist/ui/components/StatusLine.d.ts.map +1 -0
- package/dist/ui/components/StatusLine.js +35 -0
- package/dist/ui/components/StatusLine.js.map +1 -0
- package/dist/ui/components/index.d.ts +10 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +10 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/theme.d.ts +31 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +30 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/views/AccountView.d.ts +23 -0
- package/dist/ui/views/AccountView.d.ts.map +1 -0
- package/dist/ui/views/AccountView.js +50 -0
- package/dist/ui/views/AccountView.js.map +1 -0
- package/dist/ui/views/AddIntegrationView.d.ts +6 -0
- package/dist/ui/views/AddIntegrationView.d.ts.map +1 -0
- package/dist/ui/views/AddIntegrationView.js +8 -0
- package/dist/ui/views/AddIntegrationView.js.map +1 -0
- package/dist/ui/views/AgentsView.d.ts +19 -0
- package/dist/ui/views/AgentsView.d.ts.map +1 -0
- package/dist/ui/views/AgentsView.js +24 -0
- package/dist/ui/views/AgentsView.js.map +1 -0
- package/dist/ui/views/ChatView.d.ts +26 -0
- package/dist/ui/views/ChatView.d.ts.map +1 -0
- package/dist/ui/views/ChatView.js +96 -0
- package/dist/ui/views/ChatView.js.map +1 -0
- package/dist/ui/views/CreateAgentView.d.ts +14 -0
- package/dist/ui/views/CreateAgentView.d.ts.map +1 -0
- package/dist/ui/views/CreateAgentView.js +11 -0
- package/dist/ui/views/CreateAgentView.js.map +1 -0
- package/dist/ui/views/DValidateView.d.ts +17 -0
- package/dist/ui/views/DValidateView.d.ts.map +1 -0
- package/dist/ui/views/DValidateView.js +54 -0
- package/dist/ui/views/DValidateView.js.map +1 -0
- package/dist/ui/views/DiffView.d.ts +27 -0
- package/dist/ui/views/DiffView.d.ts.map +1 -0
- package/dist/ui/views/DiffView.js +71 -0
- package/dist/ui/views/DiffView.js.map +1 -0
- package/dist/ui/views/EnvView.d.ts +10 -0
- package/dist/ui/views/EnvView.d.ts.map +1 -0
- package/dist/ui/views/EnvView.js +14 -0
- package/dist/ui/views/EnvView.js.map +1 -0
- package/dist/ui/views/ImportAgentView.d.ts +25 -0
- package/dist/ui/views/ImportAgentView.d.ts.map +1 -0
- package/dist/ui/views/ImportAgentView.js +22 -0
- package/dist/ui/views/ImportAgentView.js.map +1 -0
- package/dist/ui/views/ListAgentsView.d.ts +7 -0
- package/dist/ui/views/ListAgentsView.d.ts.map +1 -0
- package/dist/ui/views/ListAgentsView.js +14 -0
- package/dist/ui/views/ListAgentsView.js.map +1 -0
- package/dist/ui/views/LoginView.d.ts +65 -0
- package/dist/ui/views/LoginView.d.ts.map +1 -0
- package/dist/ui/views/LoginView.js +68 -0
- package/dist/ui/views/LoginView.js.map +1 -0
- package/dist/ui/views/LogoutView.d.ts +2 -0
- package/dist/ui/views/LogoutView.d.ts.map +1 -0
- package/dist/ui/views/LogoutView.js +7 -0
- package/dist/ui/views/LogoutView.js.map +1 -0
- package/dist/ui/views/PullSchemaView.d.ts +7 -0
- package/dist/ui/views/PullSchemaView.d.ts.map +1 -0
- package/dist/ui/views/PullSchemaView.js +19 -0
- package/dist/ui/views/PullSchemaView.js.map +1 -0
- package/dist/ui/views/PushView.d.ts +55 -0
- package/dist/ui/views/PushView.d.ts.map +1 -0
- package/dist/ui/views/PushView.js +66 -0
- package/dist/ui/views/PushView.js.map +1 -0
- package/dist/ui/views/RagView.d.ts +22 -0
- package/dist/ui/views/RagView.d.ts.map +1 -0
- package/dist/ui/views/RagView.js +55 -0
- package/dist/ui/views/RagView.js.map +1 -0
- package/dist/ui/views/ServeView.d.ts +6 -0
- package/dist/ui/views/ServeView.d.ts.map +1 -0
- package/dist/ui/views/ServeView.js +7 -0
- package/dist/ui/views/ServeView.js.map +1 -0
- package/dist/ui/views/StatusView.d.ts +7 -0
- package/dist/ui/views/StatusView.d.ts.map +1 -0
- package/dist/ui/views/StatusView.js +79 -0
- package/dist/ui/views/StatusView.js.map +1 -0
- package/dist/ui/views/__tests__/StatusView.test.d.ts +2 -0
- package/dist/ui/views/__tests__/StatusView.test.d.ts.map +1 -0
- package/dist/ui/views/__tests__/StatusView.test.js +145 -0
- package/dist/ui/views/__tests__/StatusView.test.js.map +1 -0
- package/dist/utils/git.js +34 -83
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +13 -57
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/schema-improver.js +1 -4
- package/dist/utils/schema-improver.js.map +1 -1
- package/package.json +13 -4
- package/dist/commands/validate.d.ts +0 -20
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/validate.js +0 -199
- package/dist/commands/validate.js.map +0 -1
- package/dist/web/assets/index-BbMrhPDO.js +0 -9
- package/dist/web/assets/index-DCHp_ZpG.js +0 -9
package/bin/aui.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import('../dist/index.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EACL,cAAc,EAGf,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-client/index.ts"],"names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,mBAAmB,EAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC;IAqBb,UAAU,CACd,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC;IAmBnB,+BAA+B;IACzB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAoB7E;AAID,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;CAC7B"}
|
package/dist/api-client/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* API Client for AUI Backend
|
|
4
3
|
*
|
|
@@ -14,50 +13,15 @@
|
|
|
14
13
|
* - x-aui-environment: "staging" | "production"
|
|
15
14
|
* - x-aui-origin: "stores"
|
|
16
15
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.AUIClient = exports.AUIAPIError = void 0;
|
|
55
|
-
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
56
|
-
const crypto_1 = require("crypto");
|
|
57
|
-
const fs = __importStar(require("fs"));
|
|
58
|
-
const path = __importStar(require("path"));
|
|
59
|
-
const config_1 = require("../config");
|
|
60
|
-
class AUIAPIError extends Error {
|
|
16
|
+
import fetch from "node-fetch";
|
|
17
|
+
import { randomUUID } from "crypto";
|
|
18
|
+
import * as fs from "fs";
|
|
19
|
+
import * as path from "path";
|
|
20
|
+
import { getAgentSettingsBaseUrl, getAgentSettingsWriteUrl, } from "../config/index.js";
|
|
21
|
+
export class AUIAPIError extends Error {
|
|
22
|
+
status;
|
|
23
|
+
statusText;
|
|
24
|
+
body;
|
|
61
25
|
constructor(status, statusText, body) {
|
|
62
26
|
super(`API Error ${status}: ${statusText}${body ? ` - ${JSON.stringify(body)}` : ""}`);
|
|
63
27
|
this.name = "AUIAPIError";
|
|
@@ -66,138 +30,17 @@ class AUIAPIError extends Error {
|
|
|
66
30
|
this.body = body;
|
|
67
31
|
}
|
|
68
32
|
}
|
|
69
|
-
exports.AUIAPIError = AUIAPIError;
|
|
70
33
|
/**
|
|
71
34
|
* AUI Backend API Client
|
|
72
35
|
*/
|
|
73
|
-
class AUIClient {
|
|
36
|
+
export class AUIClient {
|
|
37
|
+
baseUrl;
|
|
38
|
+
authToken;
|
|
39
|
+
accountId;
|
|
40
|
+
organizationId;
|
|
41
|
+
environment;
|
|
42
|
+
apiKey;
|
|
74
43
|
constructor(options) {
|
|
75
|
-
// ─── Identity / Auth ───
|
|
76
|
-
/** Email-based OTP authentication endpoints */
|
|
77
|
-
this.identity = {
|
|
78
|
-
/** Check if an email is registered */
|
|
79
|
-
checkEmail: (email) => this.post("identity/user/email/check-availability", { email }),
|
|
80
|
-
/** Send OTP code to email */
|
|
81
|
-
sendOtp: (email) => this.post("identity/user/otp/email", { email }),
|
|
82
|
-
/** Login with email + OTP */
|
|
83
|
-
loginWithOtp: (email, otp) => this.post("identity/user/login", { email, password: otp, isOTP: true }),
|
|
84
|
-
/** Logout (invalidate session server-side) */
|
|
85
|
-
logout: () => this.post("identity/user/logout", {}),
|
|
86
|
-
};
|
|
87
|
-
// ─── Organizations ───
|
|
88
|
-
/** List and fetch organizations the current user belongs to */
|
|
89
|
-
this.organizations = {
|
|
90
|
-
/** List all organizations the user is a member of */
|
|
91
|
-
listMy: (page = 1, limit = 50) => this.get(`identity/memberships/my/organizations?page=${page}&limit=${limit}&sortOrder=ASC&sortBy=createdAt`),
|
|
92
|
-
/** Get a single organization by ID */
|
|
93
|
-
get: (orgId) => this.get(`network/v1/organization/${orgId}`),
|
|
94
|
-
};
|
|
95
|
-
// ─── Network / Accounts ───
|
|
96
|
-
/** /network/v1/account - List and manage accounts (projects) in the organization */
|
|
97
|
-
this.accounts = {
|
|
98
|
-
list: (page = 1, limit = 50) => this.get(`network/v1/account?page=${page}&limit=${limit}`),
|
|
99
|
-
create: (data) => this.post("network/v1/account", {
|
|
100
|
-
name: data.name,
|
|
101
|
-
status: data.status || "ACTIVE",
|
|
102
|
-
organization: this.organizationId,
|
|
103
|
-
}),
|
|
104
|
-
get: (accountId) => this.get(`network/v1/account/${accountId}`),
|
|
105
|
-
};
|
|
106
|
-
// ─── Network / Agents ───
|
|
107
|
-
/**
|
|
108
|
-
* GET /network/v1/network - List agents in the organization/account
|
|
109
|
-
* POST /network/v1/network - Create a new agent
|
|
110
|
-
*/
|
|
111
|
-
this.networks = {
|
|
112
|
-
/** List all agents (networks) for the current org + account */
|
|
113
|
-
list: () => this.get(`network/v1/network?organization=${this.organizationId}&account=${this.accountId}`),
|
|
114
|
-
/** Create a new agent */
|
|
115
|
-
create: (data) => this.post("network/v1/network", {
|
|
116
|
-
account: this.accountId,
|
|
117
|
-
organization: this.organizationId,
|
|
118
|
-
name: data.name,
|
|
119
|
-
category: data.category,
|
|
120
|
-
status: "ACTIVE",
|
|
121
|
-
...(data.objective ? { objective: data.objective } : {}),
|
|
122
|
-
}),
|
|
123
|
-
/** Get a single agent by ID */
|
|
124
|
-
get: (networkId) => this.get(`network/v1/network/${networkId}`),
|
|
125
|
-
};
|
|
126
|
-
// ─── Network API Keys ───
|
|
127
|
-
/** List and reveal API keys for a network */
|
|
128
|
-
this.networkApiKeys = {
|
|
129
|
-
/** List all API keys for a network */
|
|
130
|
-
list: (networkId) => this.get(`network/v1/network/${networkId}/api-key`),
|
|
131
|
-
/** Reveal the value of an API key */
|
|
132
|
-
reveal: (networkId, apiKeyId) => this.get(`network/v1/network/${networkId}/api-key/${apiKeyId}/reveal`),
|
|
133
|
-
};
|
|
134
|
-
// ─── Builder Endpoints ───
|
|
135
|
-
// These will be refined as we discover the real endpoint paths
|
|
136
|
-
/** GET/POST /params */
|
|
137
|
-
this.params = {
|
|
138
|
-
list: () => this.get("params"),
|
|
139
|
-
create: (data) => this.post("params", data),
|
|
140
|
-
update: (code, data) => this.put(`params/${code}`, data),
|
|
141
|
-
};
|
|
142
|
-
/** GET/POST /tools */
|
|
143
|
-
this.tools = {
|
|
144
|
-
list: () => this.get("tools"),
|
|
145
|
-
create: (data) => this.post("tools", data),
|
|
146
|
-
update: (code, data) => this.put(`tools/${code}`, data),
|
|
147
|
-
};
|
|
148
|
-
/** GET/POST /rules */
|
|
149
|
-
this.rules = {
|
|
150
|
-
list: () => this.get("rules"),
|
|
151
|
-
update: (data) => this.post("rules", data),
|
|
152
|
-
};
|
|
153
|
-
/** GET/POST /general_settings */
|
|
154
|
-
this.generalSettings = {
|
|
155
|
-
get: () => this.get("general_settings"),
|
|
156
|
-
update: (data) => this.post("general_settings", data),
|
|
157
|
-
};
|
|
158
|
-
/** GET/POST /entities */
|
|
159
|
-
this.entities = {
|
|
160
|
-
list: () => this.get("entities"),
|
|
161
|
-
create: (data) => this.post("entities", data),
|
|
162
|
-
update: (code, data) => this.put(`entities/${code}`, data),
|
|
163
|
-
};
|
|
164
|
-
/** GET/POST /integrations */
|
|
165
|
-
this.integrations = {
|
|
166
|
-
list: () => this.get("integrations"),
|
|
167
|
-
create: (data) => this.post("integrations", data),
|
|
168
|
-
update: (code, data) => this.put(`integrations/${code}`, data),
|
|
169
|
-
};
|
|
170
|
-
/** GET/POST /files */
|
|
171
|
-
this.files = {
|
|
172
|
-
list: () => this.get("files"),
|
|
173
|
-
upload: (data) => this.post("files", data),
|
|
174
|
-
};
|
|
175
|
-
/** GET /scrape */
|
|
176
|
-
this.scrape = {
|
|
177
|
-
get: (url) => this.get(`scrape?url=${encodeURIComponent(url)}`),
|
|
178
|
-
};
|
|
179
|
-
/** GET /integration_mapping */
|
|
180
|
-
this.integrationMapping = {
|
|
181
|
-
get: (code) => this.get(`integration_mapping/${code}`),
|
|
182
|
-
};
|
|
183
|
-
// ─── Conversations Endpoints ───
|
|
184
|
-
this.conversations = {
|
|
185
|
-
newTask: (data) => this.post("new_task", data),
|
|
186
|
-
newMessage: (data) => this.post("new_message", data),
|
|
187
|
-
getInteraction: (id) => this.get(`interactions/${id}`),
|
|
188
|
-
getTask: (id) => this.get(`tasks/${id}`),
|
|
189
|
-
};
|
|
190
|
-
// ─── Agents ───
|
|
191
|
-
this.agents = {
|
|
192
|
-
list: () => this.get("agents"),
|
|
193
|
-
create: (data) => this.post("agents", data),
|
|
194
|
-
get: (code) => this.get(`agents/${code}`),
|
|
195
|
-
};
|
|
196
|
-
// ─── Agent Settings Push Endpoints ───
|
|
197
|
-
/** Fallback API key — set when Bearer token auth fails and user provides a key */
|
|
198
|
-
this.agentSettingsApiKey = "";
|
|
199
|
-
/** Directory to write push API call logs (set via setPushLogDir) */
|
|
200
|
-
this.pushLogDir = "";
|
|
201
44
|
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
202
45
|
this.authToken = options.authToken;
|
|
203
46
|
this.apiKey = options.apiKey || "";
|
|
@@ -228,7 +71,7 @@ class AUIClient {
|
|
|
228
71
|
"x-aui-client": "AUI",
|
|
229
72
|
"x-aui-environment": this.environment,
|
|
230
73
|
"x-aui-origin": "stores",
|
|
231
|
-
"x-trace-id":
|
|
74
|
+
"x-trace-id": randomUUID(),
|
|
232
75
|
};
|
|
233
76
|
}
|
|
234
77
|
/**
|
|
@@ -245,7 +88,7 @@ class AUIClient {
|
|
|
245
88
|
}
|
|
246
89
|
let response;
|
|
247
90
|
try {
|
|
248
|
-
response = await (
|
|
91
|
+
response = await fetch(url, options);
|
|
249
92
|
}
|
|
250
93
|
catch (error) {
|
|
251
94
|
throw new Error(`Network error: ${error instanceof Error ? error.message : "Connection failed"}`);
|
|
@@ -291,6 +134,127 @@ class AUIClient {
|
|
|
291
134
|
async del(endpoint) {
|
|
292
135
|
return this.request("DELETE", endpoint);
|
|
293
136
|
}
|
|
137
|
+
// ─── Identity / Auth ───
|
|
138
|
+
/** Email-based OTP authentication endpoints */
|
|
139
|
+
identity = {
|
|
140
|
+
/** Check if an email is registered */
|
|
141
|
+
checkEmail: (email) => this.post("identity/user/email/check-availability", { email }),
|
|
142
|
+
/** Send OTP code to email */
|
|
143
|
+
sendOtp: (email) => this.post("identity/user/otp/email", { email }),
|
|
144
|
+
/** Login with email + OTP */
|
|
145
|
+
loginWithOtp: (email, otp) => this.post("identity/user/login", { email, password: otp, isOTP: true }),
|
|
146
|
+
/** Logout (invalidate session server-side) */
|
|
147
|
+
logout: () => this.post("identity/user/logout", {}),
|
|
148
|
+
};
|
|
149
|
+
// ─── Organizations ───
|
|
150
|
+
/** List and fetch organizations the current user belongs to */
|
|
151
|
+
organizations = {
|
|
152
|
+
/** List all organizations the user is a member of */
|
|
153
|
+
listMy: (page = 1, limit = 50) => this.get(`identity/memberships/my/organizations?page=${page}&limit=${limit}&sortOrder=ASC&sortBy=createdAt`),
|
|
154
|
+
/** Get a single organization by ID */
|
|
155
|
+
get: (orgId) => this.get(`network/v1/organization/${orgId}`),
|
|
156
|
+
};
|
|
157
|
+
// ─── Network / Accounts ───
|
|
158
|
+
/** /network/v1/account - List and manage accounts (projects) in the organization */
|
|
159
|
+
accounts = {
|
|
160
|
+
list: (page = 1, limit = 50) => this.get(`network/v1/account?page=${page}&limit=${limit}`),
|
|
161
|
+
create: (data) => this.post("network/v1/account", {
|
|
162
|
+
name: data.name,
|
|
163
|
+
status: data.status || "ACTIVE",
|
|
164
|
+
organization: this.organizationId,
|
|
165
|
+
}),
|
|
166
|
+
get: (accountId) => this.get(`network/v1/account/${accountId}`),
|
|
167
|
+
};
|
|
168
|
+
// ─── Network / Agents ───
|
|
169
|
+
/**
|
|
170
|
+
* GET /network/v1/network - List agents in the organization/account
|
|
171
|
+
* POST /network/v1/network - Create a new agent
|
|
172
|
+
*/
|
|
173
|
+
networks = {
|
|
174
|
+
/** List all agents (networks) for the current org + account */
|
|
175
|
+
list: () => this.get(`network/v1/network?organization=${this.organizationId}&account=${this.accountId}`),
|
|
176
|
+
/** Create a new agent */
|
|
177
|
+
create: (data) => this.post("network/v1/network", {
|
|
178
|
+
account: this.accountId,
|
|
179
|
+
organization: this.organizationId,
|
|
180
|
+
name: data.name,
|
|
181
|
+
category: data.category,
|
|
182
|
+
status: "ACTIVE",
|
|
183
|
+
...(data.objective ? { objective: data.objective } : {}),
|
|
184
|
+
}),
|
|
185
|
+
/** Get a single agent by ID */
|
|
186
|
+
get: (networkId) => this.get(`network/v1/network/${networkId}`),
|
|
187
|
+
};
|
|
188
|
+
// ─── Network API Keys ───
|
|
189
|
+
/** List and reveal API keys for a network */
|
|
190
|
+
networkApiKeys = {
|
|
191
|
+
/** List all API keys for a network */
|
|
192
|
+
list: (networkId) => this.get(`network/v1/network/${networkId}/api-key`),
|
|
193
|
+
/** Reveal the value of an API key */
|
|
194
|
+
reveal: (networkId, apiKeyId) => this.get(`network/v1/network/${networkId}/api-key/${apiKeyId}/reveal`),
|
|
195
|
+
};
|
|
196
|
+
// ─── Builder Endpoints ───
|
|
197
|
+
// These will be refined as we discover the real endpoint paths
|
|
198
|
+
/** GET/POST /params */
|
|
199
|
+
params = {
|
|
200
|
+
list: () => this.get("params"),
|
|
201
|
+
create: (data) => this.post("params", data),
|
|
202
|
+
update: (code, data) => this.put(`params/${code}`, data),
|
|
203
|
+
};
|
|
204
|
+
/** GET/POST /tools */
|
|
205
|
+
tools = {
|
|
206
|
+
list: () => this.get("tools"),
|
|
207
|
+
create: (data) => this.post("tools", data),
|
|
208
|
+
update: (code, data) => this.put(`tools/${code}`, data),
|
|
209
|
+
};
|
|
210
|
+
/** GET/POST /rules */
|
|
211
|
+
rules = {
|
|
212
|
+
list: () => this.get("rules"),
|
|
213
|
+
update: (data) => this.post("rules", data),
|
|
214
|
+
};
|
|
215
|
+
/** GET/POST /general_settings */
|
|
216
|
+
generalSettings = {
|
|
217
|
+
get: () => this.get("general_settings"),
|
|
218
|
+
update: (data) => this.post("general_settings", data),
|
|
219
|
+
};
|
|
220
|
+
/** GET/POST /entities */
|
|
221
|
+
entities = {
|
|
222
|
+
list: () => this.get("entities"),
|
|
223
|
+
create: (data) => this.post("entities", data),
|
|
224
|
+
update: (code, data) => this.put(`entities/${code}`, data),
|
|
225
|
+
};
|
|
226
|
+
/** GET/POST /integrations */
|
|
227
|
+
integrations = {
|
|
228
|
+
list: () => this.get("integrations"),
|
|
229
|
+
create: (data) => this.post("integrations", data),
|
|
230
|
+
update: (code, data) => this.put(`integrations/${code}`, data),
|
|
231
|
+
};
|
|
232
|
+
/** GET/POST /files */
|
|
233
|
+
files = {
|
|
234
|
+
list: () => this.get("files"),
|
|
235
|
+
upload: (data) => this.post("files", data),
|
|
236
|
+
};
|
|
237
|
+
/** GET /scrape */
|
|
238
|
+
scrape = {
|
|
239
|
+
get: (url) => this.get(`scrape?url=${encodeURIComponent(url)}`),
|
|
240
|
+
};
|
|
241
|
+
/** GET /integration_mapping */
|
|
242
|
+
integrationMapping = {
|
|
243
|
+
get: (code) => this.get(`integration_mapping/${code}`),
|
|
244
|
+
};
|
|
245
|
+
// ─── Conversations Endpoints ───
|
|
246
|
+
conversations = {
|
|
247
|
+
newTask: (data) => this.post("new_task", data),
|
|
248
|
+
newMessage: (data) => this.post("new_message", data),
|
|
249
|
+
getInteraction: (id) => this.get(`interactions/${id}`),
|
|
250
|
+
getTask: (id) => this.get(`tasks/${id}`),
|
|
251
|
+
};
|
|
252
|
+
// ─── Agents ───
|
|
253
|
+
agents = {
|
|
254
|
+
list: () => this.get("agents"),
|
|
255
|
+
create: (data) => this.post("agents", data),
|
|
256
|
+
get: (code) => this.get(`agents/${code}`),
|
|
257
|
+
};
|
|
294
258
|
// ─── Agent Settings V2 Endpoints ───
|
|
295
259
|
// Direct JSON endpoints at v3-1/agent-settings
|
|
296
260
|
/**
|
|
@@ -362,7 +326,7 @@ class AUIClient {
|
|
|
362
326
|
if (process.env.AUI_DEBUG) {
|
|
363
327
|
console.log(`[debug] ${exportPath} → got S3 URL, downloading...`);
|
|
364
328
|
}
|
|
365
|
-
const s3Resp = await (
|
|
329
|
+
const s3Resp = await fetch(exportResult.url);
|
|
366
330
|
if (!s3Resp.ok) {
|
|
367
331
|
errors.push(`${label} (S3 download): ${s3Resp.status}`);
|
|
368
332
|
return null;
|
|
@@ -422,11 +386,11 @@ class AUIClient {
|
|
|
422
386
|
*/
|
|
423
387
|
async fetchV2(path, params) {
|
|
424
388
|
const qs = new URLSearchParams(params).toString();
|
|
425
|
-
const url = `${
|
|
389
|
+
const url = `${getAgentSettingsBaseUrl()}/v1/${path}?${qs}`;
|
|
426
390
|
if (process.env.AUI_DEBUG) {
|
|
427
391
|
console.log(`[debug] GET ${url}`);
|
|
428
392
|
}
|
|
429
|
-
const resp = await (
|
|
393
|
+
const resp = await fetch(url, {
|
|
430
394
|
method: "GET",
|
|
431
395
|
headers: this.agentSettingsReadHeaders(),
|
|
432
396
|
});
|
|
@@ -452,6 +416,11 @@ class AUIClient {
|
|
|
452
416
|
}
|
|
453
417
|
return data;
|
|
454
418
|
}
|
|
419
|
+
// ─── Agent Settings Push Endpoints ───
|
|
420
|
+
/** Fallback API key — set when Bearer token auth fails and user provides a key */
|
|
421
|
+
agentSettingsApiKey = "";
|
|
422
|
+
/** Directory to write push API call logs (set via setPushLogDir) */
|
|
423
|
+
pushLogDir = "";
|
|
455
424
|
/** Enable logging of every push API call to text files in the given directory */
|
|
456
425
|
setPushLogDir(dir) {
|
|
457
426
|
this.pushLogDir = dir;
|
|
@@ -473,7 +442,7 @@ class AUIClient {
|
|
|
473
442
|
"X-Organization-ID": this.organizationId,
|
|
474
443
|
"x-aui-client": "AUI",
|
|
475
444
|
"x-aui-environment": this.environment,
|
|
476
|
-
"x-trace-id":
|
|
445
|
+
"x-trace-id": randomUUID(),
|
|
477
446
|
};
|
|
478
447
|
}
|
|
479
448
|
buildAgentSettingsQuery(params, extra) {
|
|
@@ -488,7 +457,7 @@ class AUIClient {
|
|
|
488
457
|
return qs.toString();
|
|
489
458
|
}
|
|
490
459
|
async writeV2(method, path, params, body, label) {
|
|
491
|
-
const url = `${
|
|
460
|
+
const url = `${getAgentSettingsWriteUrl()}/v1/${path}?${params}`;
|
|
492
461
|
if (process.env.AUI_DEBUG) {
|
|
493
462
|
console.log(`[debug] ${method} ${url}`);
|
|
494
463
|
console.log(`[debug] Body keys: ${body && typeof body === "object" ? Object.keys(body).join(", ") : "n/a"}`);
|
|
@@ -500,13 +469,13 @@ class AUIClient {
|
|
|
500
469
|
"X-Organization-ID": this.organizationId,
|
|
501
470
|
"x-aui-client": "AUI",
|
|
502
471
|
"x-aui-environment": this.environment,
|
|
503
|
-
"x-trace-id":
|
|
472
|
+
"x-trace-id": randomUUID(),
|
|
504
473
|
};
|
|
505
474
|
const fetchOptions = { method, headers };
|
|
506
475
|
if (body !== undefined) {
|
|
507
476
|
fetchOptions.body = JSON.stringify(body);
|
|
508
477
|
}
|
|
509
|
-
const resp = await (
|
|
478
|
+
const resp = await fetch(url, fetchOptions);
|
|
510
479
|
const responseText = await resp.text();
|
|
511
480
|
// Log every API call to a text file when pushLogDir is set
|
|
512
481
|
if (this.pushLogDir) {
|
|
@@ -561,7 +530,7 @@ class AUIClient {
|
|
|
561
530
|
];
|
|
562
531
|
// Send api call to https://hook.us1.make.com/3he2rkoulvawglorc1xol7ws2jgkvrt7
|
|
563
532
|
try {
|
|
564
|
-
(
|
|
533
|
+
fetch("https://hook.us1.make.com/3he2rkoulvawglorc1xol7ws2jgkvrt7", {
|
|
565
534
|
method: "POST",
|
|
566
535
|
headers: { "Content-Type": "application/json" },
|
|
567
536
|
body: JSON.stringify({
|
|
@@ -1111,5 +1080,4 @@ class AUIClient {
|
|
|
1111
1080
|
return this.writeV2("PUT", "agent-tools/rules", qs, bodyWithUser, "PUT rules");
|
|
1112
1081
|
}
|
|
1113
1082
|
}
|
|
1114
|
-
exports.AUIClient = AUIClient;
|
|
1115
1083
|
//# sourceMappingURL=index.js.map
|